Automatically run self-developed QT program upon startup

Source: Internet
Author: User
If you want to run your own QTProgramInstead of the interface that comes with QT, you only need

/Bin/qtopia & comment out #/bin/qtopia &

Add/opt/qtopia/bin/run. Sh

Modify

Echo "Starting qtopia, please waiting...">/dev/tty1

Is

Echo "Starting myapps, please waiting...">/dev/tty1

Put the font file (QTSource code() Copy cour. PFA cursor. PFA fontdir to/opt/friendlyarm/mini2440/root_qtopia/usr/local/Qt-embedded/lib/fonts/fontdir

Run. Sh to run our program myapps

Export LD_LIBRARY_PATH =/opt/qtopia/lib:/usr/local/lib
Export qtdir =/opt/qtopia
Export qpedir =/opt/qtopia
Export LD_LIBRARY_PATH =/opt/qtopia/lib: $ LD_LIBRARY_PATH
/Opt/qtopia/bin/myapps-qws &

Restart OK!

 

 

 

For more information, see http://my502sky.blog.163.com/blog/static/140020.572010211152478 /.

But use thisArticleIdeas,The test result is that the mouse cannot be used after Automatic startup, and some modifications have been made to ensure that the touch screen can be used normally.

The local environment is the QTE library file in/mini2440, And the QTE application is in the/home/PLG directory.

If you want to directly run your own QT program after the boot, instead of having to display the interface that comes with QT, you just need/Etc/init. d/RCSIn

/Bin/qtopia & comment out #/bin/qtopia &

Add

/Home/PLG/run. Sh & # Add an execution script line./Etc/init. d/RCs, so it will be automatically run (note that it is better to have an & so that it can be executed in the background, otherwise it is impossible to operate the console through the serial port)


Create a run under the/home/PLG directory. sh file with the following content:

export qtdir =/mini2440
export t_root =/tslib
export Path = $ qtdir/bin: $ PATH
export tslib_consoledevice = none
export tslib_fbdevice =/dev/fb0
export tslib_tsdevice =/dev/input/event0
export tslib_plugindir = $ t_root/lib/TS
export tslib_conffile = $ t_root/etc/ts. conf
export tslib_calibfile =/etc/pointercal
export qws_mouse_proto = tslib:/dev/input/event0
export LD_LIBRARY_PATH = $ t_root/lib: $ qtdir/lib

This content is exactly the same as my "QTE porting on mini2440 and cross-compilation environment setup-test through" added environment variables mentioned in this article. The content of my entire run. Sh file is as follows:

#! /Bin/sh
Export qtdir =/mini2440
Export t_root =/tslib
Export Path = $ qtdir/bin: $ path
Export tslib_consoledevice = none
Export tslib_fbdevice =/dev/fb0
Export tslib_tsdevice =/dev/input/event0
Export tslib_plugindir = $ t_root/lib/TS
Export tslib_conffile = $ t_root/etc/ts. conf
Export tslib_calibfile =/etc/pointercal
Export qws_mouse_proto = tslib:/dev/input/event0
Export LD_LIBRARY_PATH = $ t_root/lib: $ qtdir/lib
# Export qws_keyboard = TTY:/dev/tty1
/Home/PLG/spreadsheet-qws

After the restart, you can see that the QTE program you added runs automatically at startup, and we can use the touch screen normally.The principle is that the QT program depends on a lot of dynamic shared libraries. This shared library must be found during running. Therefore, you must explicitly specify the location of these shared libraries before running the QT program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.