CN113656029A - Method for responding touch screen event by applying Qt to VxWorks operating system - Google Patents

Method for responding touch screen event by applying Qt to VxWorks operating system Download PDF

Info

Publication number
CN113656029A
CN113656029A CN202110949900.0A CN202110949900A CN113656029A CN 113656029 A CN113656029 A CN 113656029A CN 202110949900 A CN202110949900 A CN 202110949900A CN 113656029 A CN113656029 A CN 113656029A
Authority
CN
China
Prior art keywords
event
operating system
touch screen
vxworks operating
mouse
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110949900.0A
Other languages
Chinese (zh)
Other versions
CN113656029B (en
Inventor
唐亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Jinhang Computing Technology Research Institute
Original Assignee
Tianjin Jinhang Computing Technology Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Jinhang Computing Technology Research Institute filed Critical Tianjin Jinhang Computing Technology Research Institute
Priority to CN202110949900.0A priority Critical patent/CN113656029B/en
Publication of CN113656029A publication Critical patent/CN113656029A/en
Application granted granted Critical
Publication of CN113656029B publication Critical patent/CN113656029B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)
  • Position Input By Displaying (AREA)

Abstract

The invention relates to a method for responding to a touch screen event by applying Qt to a VxWorks operating system, belonging to the field of VxWorks. The invention finds the file for processing the mouse event of the operating system in the Qt source code; adding initialization and opening the processing of a VxWorks operating system virtual cursor; injecting a virtual cursor event into the Qt mouse event stream; adding the processing of the virtual cursor event stream in the Qt mouse stream processing; the Qt source code is recompiled in the VxWorks operating system. The method can enable the Qt graphic application running under the VxWorks operating system to have the capability of acquiring the touch screen operation event and executing the corresponding action, is stable and reliable, and can solve the problem that the Qt application cannot normally respond to the touch screen event under the VxWorks operating system.

Description

Method for responding touch screen event by applying Qt to VxWorks operating system
Technical Field
The invention belongs to the field of VxWorks, and particularly relates to a method for responding to a touch screen event by applying Qt to a VxWorks operating system.
Background
Qt is a set of complete cross-platform graphical user interface application development framework, and is widely applied to the development of human-computer interfaces of VxWorks operating systems at present. With the continuous improvement and progress of the touch screen technology, the system has higher requirements on human-computer interaction, and the technology is more and more widely applied in the embedded field. VxWorks is used as an embedded real-time operating system, and the design of a touch screen is gradually introduced in the system design. The VxWorks operating system is mainly applied to the fields of high-tip technologies such as ships, communication, military, aerospace and the like and has extremely high real-time requirements, is not an open source operating system, and therefore supports for a touch screen are few, and secondary development is carried out on the basis of existing control and interfaces. In this case, the common development framework Qt and the touch screen driver developed secondarily have a problem of compatibility.
In order to solve the problem, event stream processing of the VxWorks operating system virtual cursor by Qt is increased based on the principle of the VxWorks operating system virtual cursor and a mechanism of Qt processing operation input, and a method for responding to a touch screen event by applying Qt to the VxWorks operating system is provided.
Disclosure of Invention
Technical problem to be solved
The invention provides a method for responding to a touch screen event by applying Qt to a VxWorks operating system, and aims to solve the problem that the Qt responds to the touch screen event on the VxWorks operating system.
(II) technical scheme
In order to solve the technical problem, the invention provides a method for responding to a touch screen event by applying Qt to a VxWorks operating system, which comprises the following steps:
s1, finding a file for processing the mouse event of the operating system in the Qt source code;
s2, adding initialization and opening the processing of a VxWorks operating system virtual cursor;
s3, injecting a virtual cursor event into the Qt mouse event stream;
s4, adding the processing of the virtual cursor event stream in the Qt mouse stream processing;
s5, recompiling Qt source codes in the VxWorks operating system.
Further, the step S1 specifically includes: finding qmousevxworks _ qws. cpp file and qmousevxworks _ qws. hpp file under Qt source code path.
Further, the step S2 specifically includes:
s21, adding a process of acquiring a VxWorks operating system virtual cursor device name in a QWSVxWorks mouseHandler function;
s22, opening the virtual cursor device and obtaining the device descriptor.
Further, the step S21 is implemented by finding whether a device of "/input/event2" exists in the system and acquiring the device name.
Further, the step S3 specifically includes:
s31, operating the virtual cursor device descriptor through ioctrl, converting the event into Qt mouse event stream and generating a signal;
s32, associating the signal generated in the step S31 to a slot function readEvdev1MouseData for processing the mouse event stream.
Further, the step S4 uses a connection mechanism of signal slots to trigger the virtual cursor event stream.
Further, the step S4 specifically includes:
s41, declaring a private slot function for processing the event stream of the virtual cursor device in a QWsuevxworks _ qws. hpp file QWxWorksMouseHandler class;
and S42, implementing the slot function stated in the step S41 in a qmousevxworks _ qws. cpp file, and finishing the processing of the mouse event stream.
Further, a slot function for processing the event stream of the virtual cursor device reads a device event from the virtual mouse device m _ virtual, judges whether the device event is a mouse moving event or a mouse button event, and transfers the event to the upper layer of Qt by calling a mouseChanged function if the device event is the moving event; if the key event is the key event, the key is judged, and then the corresponding value is assigned to the m _ buttons variable, and the variable is processed in the Qt upper-layer event.
Further, determining which key is the left key includes determining which key is the center key and the right key.
Further, the step S5 specifically includes:
s51, configuring an environment variable in VxWorks Development Shell l, and assigning a path to a directory where a Qt source code is located;
and S52, configuring Qt compiling options and executing make operation to complete Qt source code compiling.
(III) advantageous effects
The invention provides a method for responding to a touch screen event by using a Qt application under a VxWorks operating system. The technical method is verified by laboratory tests, and the result shows that the method is stable and reliable and can solve the problem that Qt cannot normally respond to touch screen events when applied to a VxWorks operating system.
Drawings
FIG. 1 is a flow chart of a method for responding to a touch screen event by applying Qt to a VxWorks operating system.
Detailed Description
In order to make the objects, contents and advantages of the present invention clearer, the following detailed description of the embodiments of the present invention will be made in conjunction with the accompanying drawings and examples.
The invention belongs to a technical method for realizing Qt graph application response touch event under a vxworks system. It is characterized in that: firstly, finding a code for processing an operating system mouse event in Qt source codes; secondly, adding initialization and opening the processing of a virtual cursor of the VxWorks operating system; thirdly, injecting a virtual cursor event into the Qt mouse event stream; fourthly, adding the processing of the virtual cursor event stream in the Qt mouse stream processing; fifthly, the modified codes in the second to fourth parts are saved and recompiled in the VxWorks operating system.
The invention discloses a method for responding to a touch screen event by applying Qt to a VxWorks operating system, which comprises the following implementation processes:
(1) modifying the source code of the Qt processing mouse event;
(2) converting the VxWorks virtual cursor event into a Qt mouse event stream;
further, adding the processing of the virtual cursor event into the Qt processing mouse event code;
further, a connection mechanism of signal slots is adopted to trigger the virtual cursor event stream.
The invention belongs to a technical method for realizing Qt graph application response touch event under a vxworks system. Under a vxworks operating system, the existing touch screen drive is few and limited by the form of an interface, and in most cases, the touch screen drive needs to be specially developed. And the development touch screen drive is based on a component of a virtual cursor under a VxWorks operating system, and after the operating system is started, a message is generated by operating the virtual cursor and is sent to a system event queue corresponding to the virtual cursor. By default, the event cannot be captured by the Qt graphical control, and therefore, when the Qt is used to develop the human-computer interface, the touch screen operation cannot be responded to normally. Under the condition, the invention provides a way for acquiring the virtual cursor operation event in Qt by modifying the Qt source code, thereby completing the response of the Qt human-computer interface to the touch screen.
In order to achieve the purpose, the invention adopts the following technical measures:
and S1, finding a file for processing the mouse event of the operating system in the Qt source code.
And S2, adding initialization and opening the virtual cursor of the VxWorks operating system.
And S3, injecting the virtual cursor event into the Qt mouse event stream.
S4, add the process to the virtual cursor event stream in the Qt mouse stream process.
S5, recompiling Qt source codes in the VxWorks operating system.
Through the steps, the problem that the Qt application software cannot normally respond to the touch screen event when running on the VxWorks operating system can be solved.
In order to solve the problem that the Qt application cannot normally respond to the touch screen event in the VxWorks operating system, the Qt application is combined with FIG. 1, and the Qt application is used for solving the problem by changing a source program of the Qt application for processing the mouse event. The present invention is further described below.
S1, finding the file for processing the mouse event of the operating system in the Qt source code
Finding a qmousevxworks _ qws. cpp file and a qmousevxworks _ qws. hpp file under the Qt source code path;
s2, adding initialization and opening processing of VxWorks operating system virtual cursor
S21, adding processing for acquiring a virtual cursor device name of the VxWorks operating system in the QWSVxWorks mouseHandler function, namely searching whether a device of "/input/event2" exists in the system and acquiring the device name;
s22, opening the virtual cursor device and obtaining the device descriptor.
S3, injecting virtual cursor event into Qt mouse event stream
S31, operating the virtual cursor device descriptor through ioctrl, converting the event into Qt mouse event stream and generating signal.
S32, associating the signal generated in the step S31 to a slot function readEvdev1MouseData for processing the mouse event stream.
S4, adding the process of virtual cursor event stream in the Qt mouse stream process
And S41, declaring a private slot function for processing the event stream of the virtual cursor device in a QWmosevxworks _ qws.
S42, the slot function stated in the step S41 is realized in a qmousevxworks _ qws. cpp file, and the processing of the mouse event stream is completed: the slot function reads a device event from the virtual mouse device m _ virtual, judges whether the device event is a mouse moving event or a mouse button event, and calls a mouseChanged function to transfer the event to the upper layer of Qt if the device event is the mouse moving event; if the key event is a key event, the key event is judged to be a left key, a middle key and a right key, and then the corresponding value is assigned to the m _ buttons variable, and the variable is processed in the Qt upper-layer event.
S5 recompiling Qt source code in VxWorks operation system
S51, configuring an environment variable in VxWorks Development Shell l, and assigning a path to a directory where a Qt source code is located;
and S52, configuring Qt compiling options and executing make operation to complete Qt source code compiling.
By utilizing the technical scheme and adopting the operation steps, the Qt graphic application running under the VxWorks operation system can have the capability of acquiring the touch screen operation event and executing the corresponding action. The technical method is verified by laboratory tests, and the result shows that the method is stable and reliable and can solve the problem that Qt cannot normally respond to touch screen events when applied to a VxWorks operating system.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for responding to a touch screen event by a Qt application under a VxWorks operating system is characterized by comprising the following steps:
s1, finding a file for processing the mouse event of the operating system in the Qt source code;
s2, adding initialization and opening the processing of a VxWorks operating system virtual cursor;
s3, injecting a virtual cursor event into the Qt mouse event stream;
s4, adding the processing of the virtual cursor event stream in the Qt mouse stream processing;
s5, recompiling Qt source codes in the VxWorks operating system.
2. The method for responding to touch screen events by using Qt application according to claim 1 under the VxWorks operating system, wherein the step S1 specifically comprises: finding qmousevxworks _ qws. cpp file and qmousevxworks _ qws. hpp file under Qt source code path.
3. The method for responding to touch screen events by using Qt application according to claim 2 under the VxWorks operating system, wherein the step S2 specifically comprises:
s21, adding a process of acquiring a VxWorks operating system virtual cursor device name in a QWSVxWorks mouseHandler function;
s22, opening the virtual cursor device and obtaining the device descriptor.
4. The method for responding to touch screen events by a Qt application according to claim 3 under the VxWorks operating system, wherein the step S21 is implemented by finding if there is a device of "/input/event2" in the system and obtaining the device name.
5. The method for responding to touch screen events by using Qt application under a VxWorks operating system according to claim 3 or 4, wherein the step S3 specifically comprises:
s31, operating the virtual cursor device descriptor through ioctrl, converting the event into Qt mouse event stream and generating a signal;
s32, associating the signal generated in the step S31 to a slot function readEvdev1MouseData for processing the mouse event stream.
6. The method for responding to touch screen events by a Qt application under the VxWorks operating system according to claim 5, wherein said step S4 employs a connection mechanism of signal slots to trigger a stream of virtual cursor events.
7. The method for responding to touch screen events by using Qt application under a VxWorks operating system according to claim 5, wherein the step S4 specifically comprises:
s41, declaring a private slot function for processing the event stream of the virtual cursor device in a QWsuevxworks _ qws. hpp file QWxWorksMouseHandler class;
and S42, implementing the slot function stated in the step S41 in a qmousevxworks _ qws. cpp file, and finishing the processing of the mouse event stream.
8. The method for responding to the touch screen event by using the Qt application according to claim 7 in the VxWorks operating system, wherein the slot function for processing the event stream of the virtual cursor device reads the device event from the virtual mouse device m _ virtual, determines whether the device event is a mouse movement event or a mouse button event, and calls a mouseChanged function to transfer the event to the upper layer of the Qt if the device event is a movement event; if the key event is the key event, the key is judged, and then the corresponding value is assigned to the m _ buttons variable, and the variable is processed in the Qt upper-layer event.
9. The method for responding to touch screen events by a Qt application under the VxWorks operating system of claim 8, wherein determining which key is comprises determining which key is left, center, or right.
10. The method for responding to touch screen events by a Qt application according to any of claims 6-9 under the VxWorks operating system, wherein the step S5 specifically comprises:
s51, configuring an environment variable in the VxWorks Development Shell, and assigning the path to the directory where the Qt source code is located;
and S52, configuring Qt compiling options and executing make operation to complete Qt source code compiling.
CN202110949900.0A 2021-08-18 2021-08-18 Method for responding to touch screen event by Qt application under VxWorks operating system Active CN113656029B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110949900.0A CN113656029B (en) 2021-08-18 2021-08-18 Method for responding to touch screen event by Qt application under VxWorks operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110949900.0A CN113656029B (en) 2021-08-18 2021-08-18 Method for responding to touch screen event by Qt application under VxWorks operating system

Publications (2)

Publication Number Publication Date
CN113656029A true CN113656029A (en) 2021-11-16
CN113656029B CN113656029B (en) 2023-08-01

Family

ID=78492245

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110949900.0A Active CN113656029B (en) 2021-08-18 2021-08-18 Method for responding to touch screen event by Qt application under VxWorks operating system

Country Status (1)

Country Link
CN (1) CN113656029B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020084991A1 (en) * 2001-01-04 2002-07-04 Harrison Edward R. Simulating mouse events with touch screen displays
US20110181520A1 (en) * 2010-01-26 2011-07-28 Apple Inc. Video out interface for electronic device
CN102929429A (en) * 2012-10-12 2013-02-13 深圳锐取信息技术股份有限公司 Method for realizing multi-point touch based on advanced reduced instruction set computer (RISC) machines (ARM) by using QT graphics development platform
CN108228360A (en) * 2016-12-21 2018-06-29 龙芯中科技术有限公司 The event communication method and apparatus of VxWorks and Qt
CN111880683A (en) * 2020-07-09 2020-11-03 天津津航计算技术研究所 Touch screen serial port drive design method based on windows virtual device under vxworks system
CN112230999A (en) * 2020-10-14 2021-01-15 天津津航计算技术研究所 Method for solving loading failure of PS2 equipment in VxWorks graph development

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020084991A1 (en) * 2001-01-04 2002-07-04 Harrison Edward R. Simulating mouse events with touch screen displays
US20110181520A1 (en) * 2010-01-26 2011-07-28 Apple Inc. Video out interface for electronic device
CN102929429A (en) * 2012-10-12 2013-02-13 深圳锐取信息技术股份有限公司 Method for realizing multi-point touch based on advanced reduced instruction set computer (RISC) machines (ARM) by using QT graphics development platform
CN108228360A (en) * 2016-12-21 2018-06-29 龙芯中科技术有限公司 The event communication method and apparatus of VxWorks and Qt
CN111880683A (en) * 2020-07-09 2020-11-03 天津津航计算技术研究所 Touch screen serial port drive design method based on windows virtual device under vxworks system
CN112230999A (en) * 2020-10-14 2021-01-15 天津津航计算技术研究所 Method for solving loading failure of PS2 equipment in VxWorks graph development

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
FH400: "Qt的鼠标和触摸屏驱动", pages 1 - 6, Retrieved from the Internet <URL:《https://blog.csdn.net/fh400/article/details/5582761》> *
JHNDNN: "QTouchEvent / Mouse event interaction", pages 1 - 3, Retrieved from the Internet <URL:《https://forum.qt.io/topic/4418/qtouchevent-mouse-event-interaction》> *
王润琪: "基于QT的触摸屏驱动在LINUX下的应用设计", 《计算机测量与控制》, pages 1429 - 1430 *

Also Published As

Publication number Publication date
CN113656029B (en) 2023-08-01

Similar Documents

Publication Publication Date Title
US20060117267A1 (en) System and method for property-based focus navigation in a user interface
US20070168953A1 (en) Unified mobile platform
US9830176B2 (en) Methods, systems, and media for binary compatible graphics support in mobile operating systems
US7877091B2 (en) Method and system for executing a container managed application on a processing device
US10303491B2 (en) Method and device of running application program across systems
CN109857303B (en) Interaction control method and device
CN106055368B (en) application updating method and device
US20160077850A1 (en) Methods, systems, and media for binary compatibility
CN111767090A (en) Method and device for starting small program, electronic equipment and storage medium
KR100678912B1 (en) Method for interpreting method bytecode and system by the same
CN103488466A (en) Method and device for executing application program
CN104063128A (en) Information processing method and electronic equipment
JP2005209173A (en) System and method for inducing asynchronous behavioral change in managed application process
CN103257788A (en) Windows desktop dynamic icon forming method
US9274622B2 (en) Device specific data in a unified pointer message
CN113656029A (en) Method for responding touch screen event by applying Qt to VxWorks operating system
CN106126213B (en) A kind of Android exploitation modeling method based on IFML
CN110543264B (en) Method, equipment and storage medium for application interaction based on split screen mode
WO2012090072A1 (en) System and method for cross virtual machine execution of applications
US10162602B2 (en) Method for handling user-level events for programming an application
CN105393214B (en) Self-revealing symbolic gestures
CN112988029B (en) Implementation method for starting soft keyboard on login interface
CN115756156A (en) Gesture event recognition method, storage medium, electronic device and intelligent cockpit
CN110908781A (en) Android application program static analysis method based on multitasking mechanism
CN112579087A (en) Development method of cooking machine human-computer interface based on Lua script

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant