![Page 2: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/2.jpg)
OutlineOutline
Why Trolltech?Why Trolltech? Why Qt?Why Qt? Qt 4 Widgets, Qt 4 Widgets, DatatypesDatatypes, and Structures, and Structures Qt DesignerQt Designer qmakeqmake Qt without C++Qt without C++ DemoDemo
![Page 3: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/3.jpg)
Why Trolltech?Why Trolltech?
Qt and Qt and Qtopia Qtopia Core are Open SourceCore are Open Source Supported by multi-million dollarSupported by multi-million dollar
companycompany
![Page 4: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/4.jpg)
Why Qt?Why Qt?
Multi-platformMulti-platform–– No No ““virtual machinesvirtual machines”” or emulation layers or emulation layers–– Native compilationNative compilation for Windows, X11, and Macfor Windows, X11, and Mac
•• Utilizes core OS technologies (Core, Aero, Utilizes core OS technologies (Core, Aero, ……))
–– Extensions - Extensions - ActiveQtActiveQt, Motif Migration, Motif Migration
![Page 5: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/5.jpg)
Why Qt?Why Qt?
Not justNot just a GUI toolkita GUI toolkit–– File handlingFile handling–– NetworkingNetworking–– Process handlingProcess handling–– ThreadingThreading–– DDatabase accessatabase access–– EEvent loop processingvent loop processing–– XML processingXML processing–– OpenGL integrationOpenGL integration–– and beyondand beyond
Over 400 C++ Classes
![Page 6: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/6.jpg)
Why Qt?Why Qt?
InternationalizationInternationalization–– Built in support for Unicode and TranslationBuilt in support for Unicode and Translation
•• Language and font aware layoutsLanguage and font aware layouts•• Bidirectional font supportBidirectional font support•• Mixed-international interfaceMixed-international interface
See See Qt LinguistQt Linguist for more for more
![Page 7: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/7.jpg)
Why Qt?Why Qt?
Not just Not just mutli-platiformmutli-platiform, , multi-architecturemulti-architecture Qtopia Qtopia Core 4 SeriesCore 4 Series
–– Support for embedded devicesSupport for embedded devices•• Cell phones, Cell phones, PDAsPDAs, etc, etc……
–– Supports Qt4 widgets with little to no codeSupports Qt4 widgets with little to no codechangechange
![Page 8: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/8.jpg)
QWidgetQWidget
The meek may inherit the earthThe meek may inherit the earth…………but the earth shall inherit but the earth shall inherit QWidgetQWidget
QWidget
![Page 9: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/9.jpg)
Qt 4 WidgetsQt 4 Widgets
Inherit the all-powerful Inherit the all-powerful QWidgetQWidget Include:Include:
–– QLabelQLabel–– QPushButtonQPushButton–– QTextBoxQTextBox–– QDialogQDialog–– QFileDialogQFileDialog–– Many, many moreMany, many more
![Page 10: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/10.jpg)
Signals and SlotsSignals and Slots
ProvideProvide communication between objectscommunication between objects A signal is emitted and slots reactA signal is emitted and slots react Getters and SettersGetters and Setters FunctionsFunctions
![Page 11: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/11.jpg)
Qt 4 Qt 4 Datatypes Datatypes & Structures& Structures
Advanced Advanced datatypesdatatypes–– QStringQString–– QDataStreamQDataStream
StructuresStructures–– QListQList–– QVectorQVector–– QMapQMap
![Page 12: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/12.jpg)
Qt DesignerQt Designer
Powerful stand-alone interface builderPowerful stand-alone interface builder Ability to Ability to integrateintegrate into into IDEsIDEs
–– KdevelopKdevelop,, Visual Studio, Visual Studio, …… Ability to Ability to previewpreview on target platforms on target platforms
–– Windows, Windows XP, Mac, Windows, Windows XP, Mac, PlastiquePlastique, CDE, and, CDE, andMotifMotif
Extensive Extensive layoutlayout system system–– Auto-scaling, font-aware layoutsAuto-scaling, font-aware layouts–– DynamicallyDynamically adjust layout for font size, direction,adjust layout for font size, direction,
display size, language, operating systemdisplay size, language, operating system
![Page 13: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/13.jpg)
![Page 14: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/14.jpg)
qmakeqmake
One project format to rule them allOne project format to rule them all Maintain .pro project fileMaintain .pro project file
–– Automatically create target projectAutomatically create target project•• MakefileMakefile•• XCodeXCode•• VisualVisual StudioStudio
![Page 15: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/15.jpg)
TEMPLATE = appINCLUDEPATH += .QT += core gui networkTARGET = iBoard
# InputHEADERS += canvas.h \
netconnect.h \scribble.h
FORMS += startup4.ui
SOURCES += canvas.cpp \netconnect.cpp \scribble.cpp \main.cpp
RESOURCES = iBoard.qrc
<!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>images/logo.png</file> <file>images/logo_mask.bmp</file> <file>images/save.png</file> <file>images/clear.png</file> <file>images/pencil.png</file> <file>images/pencil_mask.bmp</file> <file>images/eraser.png</file> <file>images/eraser_mask.bmp</file> <file>images/fill.png</file> <file>images/fill_mask.bmp</file> <file>images/print.png</file> </qresource></RCC>
Makefile
XCode Project (.xcodeproj)
Visual Studio (.vcproj)
![Page 16: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/16.jpg)
qmake qmake Command Line OptionsCommand Line Options
-project-project–– Auto-generate .pro file based on folderAuto-generate .pro file based on folder
contentscontents -spec [-spec [makespecmakespec]]
–– Build the project or make file based on theBuild the project or make file based on themake specificationmake specification•• linux-glinux-g++, ++, macx-xcodemacx-xcode, win32-mingw,, win32-mingw, ……
![Page 17: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/17.jpg)
DemoDemo
![Page 18: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/18.jpg)
Other Items of InterestOther Items of Interest
PyQt PyQt - Qt extensions for Python- Qt extensions for Python PerlQt PerlQt - Qt extensions for - Qt extensions for PerlPerl Qt/Java - Trolltech supported JavaQt/Java - Trolltech supported Java
extensionsextensions–– Coming Q1 2006Coming Q1 2006
![Page 19: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/19.jpg)
ReferencesReferences
Trolltech Trolltech www.trolltech.comwww.trolltech.com Qt ForumQt Forum www.qtforum.orgwww.qtforum.org The Qt4 ResourceThe Qt4 Resource CenterCenter qt4.qt4.digitalfanaticsdigitalfanatics.org.org Qt CentreQt Centre www.qtcentre.orgwww.qtcentre.org C++ GUI Programming in Qt 3C++ GUI Programming in Qt 3 www.phptr.com/perenswww.phptr.com/perens
Slide format and many images from TrolltechSlide format and many images from Trolltech
![Page 20: Intro to Qt - Missouri S&T - Missouri University of ...web.mst.edu/~tauritzd/courses/cs483/JasonTrent_Qt4Intro.pdfWhy Qt? Multi-platform –No “virtual machines” or emulation layers](https://reader030.vdocuments.net/reader030/viewer/2022041100/5ed78d0d74ca2b3b4d684e8f/html5/thumbnails/20.jpg)
Code Less. Create More.