GUI Programming in Embedded Linux Embedded System Lab. II
GUI 1:1 Embedded System Lab. II 2
Qt QT trolltech cross GUI QT ( ),, Mac, Linux, *nix C++ Qt X11 C++ GUI. (, ). Qt. Embedded System Lab. II 3
Qt/Embedded Qt GUI X- Frame Buffer 1. CPU 300 2. RAM 128 3. HDD 8G(linux-2G) 4. Serial Port 5. internet 6. Embeded 16bit color (ipaq) 7. ( X -> ) Embedded System Lab. II 4
QT /Embedded (1) QT /Embedded ftp://ftp.trolltech.com/qt/source/qt-embedded-free-3.3.4.tar.bz2 root (host) # tar xvjf qt-embedded-free-3.3.4.tar.bz2 // # ln s qt-embedded-free-3.3.4 qte // qte QT/ Embedded (host) - QTDIR : QT - LD_LIBRARY_PATH : QT /* ~/.bash_profile */ export QTDIR=/root/qte export LD_LIBRARY_PATH=/root/qte/lib:$ LD_LIBRARY_PATH Embedded System Lab. II 5
QT /Embedded (2) (host) # source ~/.bash_profile //.bash_profile QT/Emdedded Configuration(host) yes #./configure -embedded ipaq -shared -depths 8,16,24,32 -thread -no-cups -qt-mouse-linuxtp Embedded System Lab. II 6
QT /Embedded (3) libstdc++.a (host) libstdc++.a libstdc++ lib. /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/libstdc++.a () Uic(host) # cd /usr/lib/gcc-lib/i386-redhat-linux/3.2.2 # cp libstdc++.a /usr/local/huins-arm-linux-r1.1/lib/libstdc++.a QT/Embedded qt-x11 uic. /usr/lib/qt-3.1/bin/uic () # cd /usr/lib/qt-3.1/bin/uic # cp uic $QTDIR/bin Embedded System Lab. II 7
QT /Embedded (4) (host) # cd $QTDIR # make QT/Embedded ARM library. Embedded System Lab. II 8
QT /Embedded (5) ARM qt-embedded-free-3.3.4 qte NFS.(target) qt NFS.(host) /* /etc/exports */ /root/qte 192.168.1.253(rw, no_root_squash) # service nfs restart // restart ~/.profile (target) target# mount t nfs 192.168.1.252:/root/qte /mnt/nfs/qte //nfs mount /* ~/.profile */ export QTDIR=/mnt/nfs/qte export LD_LIBRARY_PATH=/mnt/nfs/qte/lib:$LD_LIBRARY_PATH export QWS_MOUSE_PROTO=linuxtp:/dev/ts target# source ~/.profile // Embedded System Lab. II 9
QT /Embedded (6) libstdc++ (target) target# cp libstdc++.a /lib //host libstdc++ target target# cd /lib // /lib target# ln s /lib/libstdc++.a libstdc++-libc6.1-2.so.3 // Host target ~/.profile ~/.profile Embedded System Lab. II 10
QT /Embedded (7) Host Qt/Embedded. Qt Xindow., ps xwindow kill -9 75 xwindow. Embedded System Lab. II 11
QT /Embedded (8) (target) #./hello qws // X. Embedded System Lab. II 12
QT /Embedded Application(1) Qt/E 1:1 Embedded System Lab. II 13
QT /Embedded Application(2) - (). Connect. Disconnect. IP information / Embedded System Lab. II 14
QT /Embedded Application(3) 1. Connect 2. 3. OK IP Port IP number Embedded System Lab. II 15
QT /Embedded Application(4) CSockIo : (UDP ) CConnectDlg : CGameBoard : MainWindow : MainWindow Embedded System Lab. II 16
QT /Embedded Application(5) Client First Start Server Client Start ok Game Game Embedded System Lab. II 17
QT /Embedded Application(6) 14*14 2. 5. Vertical, Horizontal, LeftDown, RightDown 5. Embedded System Lab. II 18
QT /Embedded Application(7). /,... socket udp packet socket Embedded System Lab. II 19
QT /Embedded Application(8) command x y message COMMAND CONNECT CONNECT_ACK CLOSE SHOOT SHOOT_ACK MESSAGE Embedded System Lab. II 20
QT /Embedded Application(9) client server OnNewPacketConnect() connect connect_ack OnNewPacketConnectAck() OnNewPacketShoot() game start shoot shoot_ack OnNewPacketShootAck() OnNewPacketClose() close game quit Embedded System Lab. II 21
QT /Embedded Application(10) * Embedded System Lab. II 22
QT /Embedded Application(11) Makefile Makefile #qmake spec /root/qt-embedded-free-3.3.4/mkspecs/qws/linux-ipag-g++ -o Makfile omol_arm.pro qmake $QTDIR/example Makefile. Makefile Makefile. Gcc arm-linux-gcc. Embedded System Lab. II 23
QT /Embedded Application(12) QT QT app nfs. Embedded System Lab. II 24
QT /Embedded Application(13) ~/.profile host QT,. # source ~/.profile... Embedded System Lab. II 25
QT /Embedded Application(14) app ip. 1 2. xwindow app. Embedded System Lab. II 26
QT /Embedded Application(15) 1 Embedded System Lab. II 27
QT /Embedded Application(16) 2 KIT 2 Embedded System Lab. II 28