Qt download: http://qt.nokia.com/downloads
Qt SDK for Open Source C ++ development on Linux/X11 32-bit is a pc sdk, including qtcreator.
Qt for Open Source C ++ development on Embedded Linux is an embedded development library.
Only the installation of ARM is described here.
1. Compile the tslib Library
Tslib1.41 provided by day embed download: http://download.csdn.net/source/2661205
Make sure that the configuration is correct. Otherwise, the touch screen may only move the mouse and cannot be clicked.
View plaincopy
To clipboardprint?
- . /Configure -- Host = arm-Linux-disable-hp3600 -- disable-arctic2 -- disable-mk712 -- disable-collie -- disable-corgi -- disable-ucb1x00 -- disable-linear-h2200 -- With-GNU-LD -- prefix =/opt/QT/ tslib ac_cv_func_malloc_0_nonnull = Yes
. /Configure -- Host = arm-Linux-disable-hp3600 -- disable-arctic2 -- disable-mk712 -- disable-collie -- disable-corgi -- disable-ucb1x00 -- disable-linear-h2200 -- With-GNU-LD -- prefix =/opt/QT/ tslib ac_cv_func_malloc_0_nonnull = Yes
Make and make install after configuration. Install tslib in/opt/QT/tslib.
2: Compile QT-embedded-arm and install it in/opt/QT/qt-embedded-4.6.3-arm. Create a config. Sh file to save the configuration and run./config. Sh. The content is as follows:
View plaincopy
To clipboardprint?
- . /Configure-Prefix/opt/QT/qt-embedded-4.6.3-arm-release-opensource-shared-fast-no-largefile-QT-SQL-SQLite-no-qt3support-no-xmlpatterns-no-MMX-no-3dnow -No-SSE-no-sse2-no-SVG-no-WebKit-QT-zlib-QT-GIF-QT-LibTIFF-QT-libpng-QT-libjpeg-make libs-nomake examples -nomake docs-nomake demo-no-Nis-no-cups-no-iconv-no-signature-no-OpenSSL-xplatform qws/Linux-arm-G ++-Embedded ARM -Little-Endian-QT-FreeType-Depths 16,18-QT-GFX-linuxfb-QT-GFX-transformed-QT-GFX-multiscreen-no-GFX-VNC-no-GFX- qvfb-QT-KBD-linuxinput-no-glib-QT-mouse-tslib-I/opt/QT/tslib/include-L/opt/QT/tslib/lib
. /Configure-Prefix/opt/QT/qt-embedded-4.6.3-arm-release-opensource-shared-fast-no-largefile-QT-SQL-SQLite-no-qt3support-no-xmlpatterns-no-MMX-no-3dnow -No-SSE-no-sse2-no-SVG-no-WebKit-QT-zlib-QT-GIF-QT-LibTIFF-QT-libpng-QT-libjpeg-make libs-nomake examples -nomake docs-nomake demo-no-Nis-no-cups-no-iconv-no-signature-no-OpenSSL-xplatform qws/Linux-arm-G ++-Embedded ARM -Little-Endian-QT-FreeType-Depths 16,18-QT-GFX-linuxfb-QT-GFX-transformed-QT-GFX-multiscreen-no-GFX-VNC-no-GFX- qvfb-QT-KBD-linuxinput-no-glib-QT-mouse-tslib-I/opt/QT/tslib/include-L/opt/QT/tslib/lib
However, if this is the case, the segmentation fault error will occur after porting to the Development Board (although the QT program can be started twice). This error is actually caused by the linuxfb problem in the graphic buffer zone, you can modify the qt-everywhere-opensource-src-4.6.3/src/GUI/Embedded/qscreenlinuxfb_qws.cpp source code:
About 424 rows:
View plaincopy
To clipboardprint?
- /* // Embedsky_del start 20091208
- Canaccel = useoffscreen ();
- If (canaccel)
- Setupoffscreen ();
- * // Embedsky_del end 20091208
- Canaccel = false;
/* // Embedsky_del start 20091208 <br/> canaccel = useoffscreen (); <br/> If (canaccel) <br/> setupoffscreen (); <br/> * // embedsky_del end 20091208 <br/> canaccel = false;
About 726 rows:
View plaincopy
To clipboardprint?
- /* // Embedsky_del start 20091208
- If (canaccel ){
- * Entryp = 0;
- * Lowest = mapsize;
- Insert_entry (* entryp, * Lowest, * Lowest); // dummy entry to mark start
- }
- * // Embedsky_del end 20091208
- Canaccel = false;
/* // Embedsky_del start 20091208 <br/> If (canaccel) {<br/> * entryp = 0; <br/> * Lowest = mapsize; <br/> insert_entry (* entryp, * Lowest, * Lowest ); // dummy entry to mark start <br/>}< br/> * // embedsky_del end 20091208 <br/> canaccel = false; <br/>
In addition, if some unnecessary or unsupported hardware options are not removed in./configure, segmentation fault may occur. For the S3C2440 Development Board, refer to the above configuration.
After modification, make and make install
3: Copy all the so files under tslib/lib to the qt-embedded-4.6.3-arm/lib (if you do not copy it, some libraries cannot be found when compiling the program in step 1 ). The Ts and pkgconfig folders can be copied.
4: copy the lib and plugins folders under the qt-embedded-4.6.3-arm to/opt/qt4.6.3 under the Development Board file system. Then, delete files other than. So and retain only the required font.
5: copy the tslib/etc/ts. conf file to the/etc File System of the Development Board, and remove the # number before the second line.
View plaincopy
To clipboardprint?
- # Uncomment if you wish to use the Linux input layer event Interface
- Module_raw Input
# Uncomment if you wish to use the Linux input layer event interface <br/> module_raw Input
6. Load the QT runtime environment variable and modify the/etc/profile file of the Development file system.
View plaincopy
To clipboardprint?
- # Ash Profile
- # VIM: syntax = sh
- # No core files by default
- # Ulimit-s-c 0>/dev/null 2> & 1
- ############# QT start #################
- Export set qtdir =/opt/qt4.6.3
- Export set qws_display = "linuxfb:/dev/fb0"
- Export set qws_display = "linuxfb: mmwidth130: mmheight100: 0"
- Export set qws_keyboard = "TTY:/dev/tty1"
- If [-F/sys/class/input/input0/uevent]; then
- Export set tslib_tsdevice =/dev/event0
- Export set tslib_calibfile =/etc/pointercal
- Export set tslib_conffile =/etc/ts. conf
- Export set tslib_plugindir = $ qtdir/lib/TS
- Export set qws_mouse_proto = "tslib:/dev/event0"
- Fi
- Export set qt_qws_fontdir = $ qtdir/lib/fonts/
- Export set Path = $ qtdir/bin: $ path
- Export set LD_LIBRARY_PATH = $ qtdir/lib: $ qtdir/plugins/imageformats: $ LD_LIBRARY_PATH
- ############## QT end #####################
- User = "'id-UN '"
- LOGNAME = $ user
- PS1 = '[/u @/h/W] #'
- Path = $ path
- Hostname = '/bin/hostname'
- Export user LOGNAME PS1 path
# Ash profile <br/> # VIM: syntax = sh <br/> # No core files by default <br/> # ulimit-s-c 0>/dev/null 2> & 1 <br/> ### ########### QT start ################# <br/> export set qtdir =/OPT /qt4.6.3 <br/> export set qws_display = "linuxfb: /dev/fb0 "<br/> export set qws_display =" linuxfb: mmwidth130: mmheight100: 0 "<br/> export set qws_keyboard =" TTY: /dev/tty1 "<br/> If [-F/sys/class/input/input0/uevent]; then <br/> export set tslib_tsdevice =/dev/event0 <br/> export set tslib_calibfile =/etc/pointercal <br/> export set tslib_conffile =/etc/ts. conf <br/> export set tslib_plugindir = $ qtdir/lib/TS <br/> export set qws_mouse_proto = "tslib: /dev/event0 "<br/> fi <br/> export set qt_qws_fontdir = $ qtdir/lib/fonts/<br/> export set Path = $ qtdir/bin: $ PATH <br/> export set LD_LIBRARY_PATH = $ qtdir/lib: $ qtdir/plugins/imageformats: $ LD_LIBRARY_PATH <br/> ############## QT end ################## ### <br/> User = "'id-UN'" <br/> LOGNAME = $ user <br/> ps1 = '[/u @/h/W] # '<br/> Path = $ PATH <br/> hostname ='/bin/hostname' <br/> Export user LOGNAME PS1 path
Now you can run the QT program on the Development Board.
7. Start the QT Program
Since the boot program is in/etc/init. d/RC is loaded. However, to run the QT program, you must first set the environment variable for running QT. The/etc/profile is in/etc/init. d/RC is loaded, so to start the program, you must first set the environment. Here we can use a script to set the environment and start the program. Create a new file qt4, put it in bin or sbin, and set its permissions to executable. The content is as follows: (Here we start a qtbeep program compiled by myself)
View plaincopy
To clipboardprint?
- #! /Bin/sh
- Echo start qt4.6.3>/dev/tq2440_serial0
- Export set qtdir =/opt/qt4.6.3
- Export set qws_display = "linuxfb:/dev/fb0"
- Export set qws_display = "linuxfb: mmwidth130: mmheight100: 0"
- Export set qws_keyboard = "TTY:/dev/tty1"
- If [-F/sys/class/input/input0/uevent]; then
- Export set tslib_tsdevice =/dev/event0
- Export set tslib_calibfile =/etc/pointercal
- Export set tslib_conffile =/etc/ts. conf
- Export set tslib_plugindir = $ qtdir/lib/TS
- Export set qws_mouse_proto = "tslib:/dev/event0"
- Fi
- Export set qt_qws_fontdir = $ qtdir/lib/fonts/
- Export set Path = $ qtdir/bin: $ path
- Export set LD_LIBRARY_PATH = $ qtdir/lib: $ qtdir/plugins/imageformats: $ LD_LIBRARY_PATH
- If [-F/etc/pointercal]; then
- $ Qtdir/bin/qtbeep-qws 1>/dev/null 2>/dev/null
- Else
- $ Qtdir/bin/ts_calibrate
- $ Qtdir/bin/qtbeep-qws 1>/dev/null 2>/dev/null
- Fi
#! /Bin/sh <br/> echo start qt4.6.3>/dev/tq2440_serial0 <br/> export set qtdir =/opt/qt4.6.3 <br/> export set qws_display = "linuxfb: /dev/fb0 "<br/> export set qws_display =" linuxfb: mmwidth130: mmheight100: 0 "<br/> export set qws_keyboard =" TTY: /dev/tty1 "<br/> If [-F/sys/class/input/input0/uevent]; then <br/> export set tslib_tsdevice =/dev/event0 <br/> export set tslib_calibfile =/etc/pointercal <br/> export set tslib_conffile =/etc/ts. conf <br/> export set tslib_plugindir = $ qtdir/lib/TS <br/> export set qws_mouse_proto = "tslib: /dev/event0 "<br/> fi <br/> export set qt_qws_fontdir = $ qtdir/lib/fonts/<br/> export set Path = $ qtdir/bin: $ PATH <br/> export set LD_LIBRARY_PATH = $ qtdir/lib: $ qtdir/plugins/imageformats: $ LD_LIBRARY_PATH <br/> If [-F/etc/pointercal]; then <br/> $ qtdir/bin/qtbeep-qws 1>/dev/null 2>/dev/null <br/> else <br/> $ qtdir/bin/ts_calibrate <br/> $ qtdir/bin/qtbeep-qws 1>/dev/null 2>/dev/null <br/> fi
In this way, we can directly add qt4 & to/etc/init. d/RCS.
(Note: This environment variable only affects the programs started in qt4. The environment variable after entering the system depends on/etc/profile)