90 likes | 210 Views
Neuros Technology GUI Application Development with Qt4. OSCON USA 2008. Cross-Platform Tools with Embedded Development. Qt4 offers many advantages for Embedded Development Cross-Architecture ARM, MIPS, x86, PPC, SPARC Cross-Platform Linux, BSD, Solaris, Windows, Windows CE
E N D
IP moves upwards Neuros Technology GUI Application Development with Qt4 OSCON USA 2008
IP moves upwards Cross-Platform Tools with Embedded Development • Qt4 offers many advantages for Embedded Development • Cross-Architecture • ARM, MIPS, x86, PPC, SPARC • Cross-Platform • Linux, BSD, Solaris, Windows, Windows CE • Varying Hardware • Cell Phones, Set-Top Boxes, PC, Thin Clients All of these different development platforms are able to use the same source code
IP moves upwards Step 1: Your Designed Window(step 1: mainwindow.ui)
IP moves upwards Step 2: Attach Classes to Designer form • Following Qt4 Guides using Multiple Inheritance with Designer forms, all standard Qt4 • Created (view if wanted) • mainwindow.cpp • mainwindow.h • main.cppFor details on how to build Qt4 GUI C++ source code, follow guides on: http://doc.trolltech.com
IP moves upwards Step 2: Main menu Example of Main Function: #include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication app(argc,argv); // Configure QApp // Setup application info QCoreApplication::setOrganizationName("Neuros"); QCoreApplication::setOrganizationDomain("neurostechnology.com"); QCoreApplication::setApplicationName("TestText"); // Create the window and show maximized MainWindow window; window.showMaximized(); app.exec(); // Start Event Loop }
IP moves upwards Step 3: Compile for PC • Compile and Run Qt4 application to for the PC • ~/$ cd ~/OSCON/step3 • ~OSCON/step3$: qmake -project • ~OSCON/step3$: qmake • ~OSCON/step3$: make • ~OSCON/step3$: ./step3
IP moves upwards Step 4: Compiling for ARM • Compiling same application for ARM/OSD is very simple • First you source the cross compile enviroment so the toolchain is in the path. This makes an alias for the toolchain/Qt/bin/qmake that we can use to be sure we run ARM qmake not PC qmake • Using the same exact source we compile with the same steps as we did with the PC version (this time things renamed step4)
IP moves upwards Step 4: Building for ARM/OSD • ~/$ source /neuros/neuros-bsp/neuros-env • ~/$ cd ~/OSCON/step4 • ~OSCON/step4$: nqmake -project • ~OSCON/step4$: nqmake • ~OSCON/step4$: make • ~OSCON/step4$: cp step4 /neuros/neuros-bsp/rootfs/fs/ • In Minicom (Serial Console): • ~#: /stepnqmake is an alias for qmake that is located in the arm toolchain directory. Without an alias the system would just think you wanted to use the local qmake
IP moves upwards The PC/ARM Application With the same source code we can now run the same exact application on both ARM and PC. This simplifies the entire development process • Debugging on PC is easier • Great compatibility for multiple arch • Write once, use everywhere source code!