Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to transplant the touch function of qt4 to the application helloworld

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to transplant the touch function of qt4 to the application helloworld", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to transplant the touch function of qt4 to the application helloworld" this article.

How to transplant the touch function of qt4 to the application helloworld.

11.3.2.1 Mouse and Touch

As shown below, open the "etc/init.d/rcS" file and change the last line to "/ bin/qt4_shell &" so that

The system will run the qt4.shell program after power on. After the modification is complete, save and exit.

Then use the command "# cp-r bin/qt4 bin/qt4.shell" to copy the "bin/qt4" file to generate

"bin/qt4.shell" file, as shown in the following figure.

Then open the bin/qt4.shell file, as shown in the following figure.

The code "export TSLIB_ROOT=/usr/local/tslib" calls touch and mouse drivers.

The code "export QTDIR=/opt/qt-4.7.1/" invokes QtE's library.

As shown in the following figure, this paragraph about the mouse driver has been commented out.

Modify the code related to touching the mouse in the image above to the following code.

If [!-c / dev/input/event2]; then

Export QWS_MOUSE_PROTO='Tslib:/dev/input/event2'

# if [- e / etc/pointercal-a!-s / etc/pointercal]; then

If [- e / etc/pointercal]; then

Fsize=$ (/ bin/ls-al / etc/pointercal | cut-d'-f 23)

Echo $fsize

# if [- s / etc/pointercal]; then

If [$fsize-ge "1]; then

Echo "/ etc/pointercal is exit"

Else

Echo "/ etc/pointercal is empty"

Rm / etc/pointercal

/ usr/local/tslib/bin/ts_calibrate

Fi

Else

Echo "/ etc/pointercal not found"

/ usr/local/tslib/bin/ts_calibrate

Fi

Else

Export QWS_MOUSE_PROTO= "MouseMan:/dev/input/mice"

# > / etc/pointercal

Fi

# export QWS_MOUSE_PROTO= "Tslib {TSLIB_TSDEVICE}"

# / usr/local/tslib/bin/ts_calibrate

On the first line of the code above, there is "!" The mouse is supported; the touch should not work properly.

If you get rid of "!" Touch is supported. Need to calibrate first, use the above code to calibrate only once, not every

Check every time.

In addition, if the user does not click on the "cross box" in turn during the first calibration, there may be a problem touching the file

Then you can refer to Section 7.3.3, delete the "/ etc/point*" file, restart the development board and calibrate again.

After modifying this code, it's best to delete the "/ etc/point*" file. For example, if the user has just started using

Is to touch, and then change to mouse control, because the "/ etc/point*" file already exists, so it will make people feel that the mouse can

Use, touch can be used but there is a problem, this time delete the "/ etc/point*" file and restart.

11.3.2.2 Font

As shown in the following figure, then find the parameters that control the font.

Put

"export QWS_DISPLAY=Transformed:Rot0"

Modified to:

"export QWS_DISPLAY=Transformed:Rot90"

Then restart the development board, and when the development board is up, you will find that the screen rotates 90 degrees.

1.3.2.4 modify the default startup program

As shown in the following figure, on the last line, the red box starts the routine that comes with QtE by default, which is changed to

". / bin/helloworld-qws" (where the helloworld program is generated in section 11.2, put it in the / bin directory

Below), the code in the red box can be commented or deleted.

The above is all the content of the article "how to transplant the touch function of qt4 into the application helloworld". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report