User Tools

Site Tools


qt-embedded

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
qt-embedded [2013/06/11 02:32]
maxx created
qt-embedded [2013/06/11 03:31] (current)
maxx [Qt application with touchscreen support]
Line 9: Line 9:
 </​code>​ </​code>​
 Other tools like autogen, libtool and others are considered to be installed on a development host. Other tools like autogen, libtool and others are considered to be installed on a development host.
 +==== Compile Qt sources ====
  
 Download qt sources from '​ftp://​ftp.qt-project.org/​qt/​source/'​. To avoid problems connected with the latest Qt 5.x version we'll use the latest from 4.x series: 4.8.1 Download qt sources from '​ftp://​ftp.qt-project.org/​qt/​source/'​. To avoid problems connected with the latest Qt 5.x version we'll use the latest from 4.x series: 4.8.1
Line 18: Line 19:
 tar xf qt-everywhere-opensource-src-4.8.1.tar.gz tar xf qt-everywhere-opensource-src-4.8.1.tar.gz
 </​code>​ </​code>​
-Now we need to specify a proper configuration that is suitable for our target system. Let's presume that we want to work only with a touchscreen for input and omit Java, SQL and WebKit support. You can still enable these packets, it only affects the build time.+Now we need to specify a proper configuration that is suitable for our target system. Let's presume that we want to work only on a target without X-system installed, ​with a touchscreen for input and omit Java, SQL and WebKit support. You can still enable these packets, it only affects the build time. Qt can be a X-server itself if it's run with a key '​-qws'​.
  
 First, let's specify the cross-environment configuration. For this modify the file '​mkspecs/​qws/​linux-arm-gnueabi-g++/​qmake.conf'​ and make it as suggested: First, let's specify the cross-environment configuration. For this modify the file '​mkspecs/​qws/​linux-arm-gnueabi-g++/​qmake.conf'​ and make it as suggested:
Line 50: Line 51:
  
 load(qt_config) load(qt_config)
-<​code>​+</code>
 Please pay attention that we include the Include- and Library- paths to the build as TSLIB_INCDIR and TSLIB_LIBDIR. Please pay attention that we include the Include- and Library- paths to the build as TSLIB_INCDIR and TSLIB_LIBDIR.
  
Line 57: Line 58:
 ./configure -prefix /​opt/​qte4.8.1 -embedded arm -platform qws/​linux-x86-g++ -xplatform qws/​linux-arm-gnueabi-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -fast -qt-mouse-tslib -nomake demos -nomake examples -no-svg -no-phonon -no-qt3support -no-svg -qt-gfx-linuxfb -no-javascript-jit -confirm-license -opensource -no-webkit ./configure -prefix /​opt/​qte4.8.1 -embedded arm -platform qws/​linux-x86-g++ -xplatform qws/​linux-arm-gnueabi-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -fast -qt-mouse-tslib -nomake demos -nomake examples -no-svg -no-phonon -no-qt3support -no-svg -qt-gfx-linuxfb -no-javascript-jit -confirm-license -opensource -no-webkit
 </​code>​ </​code>​
 +For the installation path we chose '/​opt/​qte4.8.1'​ but you can choose the one you like.
  
 +Next, run make and make install: 
 +<​code>​ 
 +make && make install 
 +</​code>​ 
 +So, finally you are able to compile an application for an ARM target running on a Ubuntu Core file system. To compile the application go to a folder with a *.pro file and run there qmake, like: 
 +<​code>​ 
 +/​opt/​qte4.8.1/​bin/​qmake 
 +</​code>​ 
 +Then usual make 
 +<​code>​ 
 +make 
 +</​code>​ 
 +You will have a dynamically linked binary intended to run on a ARM system. However, as we chose the build with shared libraries, at first you need to install same libraries and fonts to the target. For this you can pack the whole folder '/​opt/​qte4.8.1',​ upload it to the target and then unpack it in the same destination ​ '/​opt',​ so both the host and the target had the same paths to the libraries and fonts. After this you are able to run applications cross-compiled at a x86 linux system. 
 +==== Qt application with touchscreen support ==== 
 +For Tslib installation instructions refer to the page [[tslib]] 
 +<​code>​ 
 +export QWS_MOUSE_PROTO=tslib:/​dev/​input/​event0 
 +export TSLIB_CALIBFILE=/​usr/​local/​etc/​pointercal 
 +export TSLIB_CONFFILE=/​usr/​local/​etc/​ts.conf 
 +export TSLIB_PLUGINDIR=/​usr/​local/​lib/​ts 
 +</​code>​ 
 +To run an application with touchsreen input you can export all variables as described above, or simply run the application by issuing the command: 
 +<​code>​ 
 +QWS_MOUSE_PROTO=tslib:/​dev/​input/​event0 ./your-app -qws 
 +</​code>​
qt-embedded.1370932326.txt.gz · Last modified: 2013/06/11 02:32 by maxx