最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

How to add QT support in buildroot and Run qt demo in rootfs

工作和技术 crifan 4691浏览 0评论

How to add QT support in buildroot and Run qt demo in rootfs

Note:
follow is verified for buildroot-2009.08

1. configure in buildroot
(1)make sure has select C++ support:
   Toolchain —>
[*] Build/install c++ compiler and libstdc++?

(2) only choose QT support, not choose X.org support
Package Selection for the target —>
Graphic libraries and applications (graphic/text) —>
[*] Qt —>  
     [ ]   Compile with debug support                                                                | |
           Library type (Shared library) —>                                                       | |
     [ ]   Use commercial license                                                                    | |
     [*]     Approve free license                                                                    | |
     [ ]   Compatibility with Qt3                                                                    | |
     [*]   Gui Module                                                                                | |
             Pixel depths —>                                                                      | |
     [ ]     Enable GIF support                                                                      | |
     [ ]     Enable libmng support                                                                   | |
             JPEG support (Use Qt bundled libjpeg) —>                                             | |
             PNG support (No PNG support) —>                                                      | |
             TIFF support (No TIFF support) —>                                                    | |
           zlib support (Qt zlib) —>                                                              | |
           freetype2 support (no freetype2 support) —>                                            | |
     (arm) The embedded platform we are making Qt for                                                | |
     [ ]   SQL Module —>                                                                          | |
           Graphics drivers —>                                                                    | |
           Mouse drivers —>                                                                       | |
     [ ]   Phonon Module                                                                             | |
     [*]   XML Module                                                                                | |
     [ ]     XML Patterns Module                                                                     | |
     [ ]   SVG Module                                                                                | |
     -*-   Network Module                                                                            | |
     [ ]     WebKit Module                                                                           | |
     [ ]   STL support                                                                               | |
     [ ]   Enable OpenSSL support                                                                    | |
     [*]   Script Module                                                                             | |
     [ ]     Script Tools Module      
Note:
(1)"Approve free license" will auto add "-confirm-license" to ./configure,
if not select it, you need auto input "yes" when compile qtopia.

(3) edit qt cofigure
edit package/qt.mk from:
——————————

QT_CONFIGURE:=#empty

   ./configure
   $(if $(VERBOSE),-verbose,-silent)
   -force-pkg-config
   -embedded $(BR2_PACKAGE_QT_EMB_PLATFORM)
   $(QT_QCONFIG_COMMAND)
   $(QT_CONFIGURE)
   -no-cups
   -no-nis
   -no-accessibility
   -no-separate-debug-info
   -hostprefix $(STAGING_DIR)/usr
   -no-rpath
)

——————————
to:
——————————

#QT_CONFIGURE:= -prefix /usr -fast -nomake examples -nomake demos
QT_CONFIGURE:= -prefix $(TARGET_DIR)/usr -no-fast

   ./configure
   $(if $(VERBOSE),-verbose,-silent)
   -force-pkg-config
   -embedded $(BR2_PACKAGE_QT_EMB_PLATFORM)
   $(QT_QCONFIG_COMMAND)
   $(QT_CONFIGURE)
   -no-cups
   -no-nis
   -no-accessibility
   -no-separate-debug-info
   -hostprefix $(STAGING_DIR)/usr
   -no-rpath
)
…..
——————————
Note:
A.-prefix $(TARGET_DIR)/usr
will tell the qt to install the generated qtopia libs, demos and examples into:
buildroot_dir/project_build_arm/uclibc/root/usr
B.-no-fast
will let qtopia to make all things, include demos and examples
C.more info about these parameter, please goto root dir of qtopia source(after make the qtopia):
buildroot_dir/build_arm/qt-embedded-linux-opensource-src-4.5.2/
do:
./configure –help

2.build qtopia
in buildroot, just do:
make
then can generate the rootfs with the support of qtopia, and you can find the:
qtopia libs in buildroot_dir/project_build_arm/uclibc/root/usr/lib
qtopia demos and examples under buildroot_dir/project_build_arm/uclibc/root/usr

3.run qtopia demo in board
(1) after booting board, configure necessary environments:
export QTDIR=/usr
export LD_LIBRARY_PATH=$QTDIR/lib
export QT_QWS_FONTDIR=$QTDIR/lib/fonts
export QWS_DISPLAY="LinuxFb:/dev/fb0"
Note:
export QWS_DISPLAY="LinuxFb:/dev/fb0"
can be repalced by:
export QWS_DISPLAY="LinuxFb:mmWidth480:mmHeight272:0"
export QWS_SIZE="480×272"
in which, our LCDis 480X272

(2) then can run any demo or example to check qtopia is work OK, such as:
/usr/examples/graphicsview/collidingmice/collidingmice -qws
/usr/examples/graphicsview/elasticnodes/elasticnodes -qws
/usr/demos/mainwindow/mainwindow -qws
Note:
-qws means this app is server by itself.Normally in embedded system, there is no server, so need this to destinate this app server by itself.
more info please refer:

http://doc.trolltech.com/4.3/qtopiacore-pointer.html
http://qt.nokia.com/doc/qtopia4.3/qtopiacore-running.html#using-a-single-display

[Tips]

1.more info about the necessary environment setting, please refer:

http://doc.trolltech.com/4.3/qtopiacore-envvars.html

2. more info about touch screen/ touch panel, please refer this :

http://doc.trolltech.com/4.3/qtopiacore-pointer.html

转载请注明:在路上 » How to add QT support in buildroot and Run qt demo in rootfs

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
79 queries in 0.157 seconds, using 22.13MB memory