2. Qt Creator IDE - native IDE for Qt
• free, open-source and cross-platform
• full development cycle out of the box
• QtWidget and QtQuick WYSIWYG design tools
• fast but multifunctional
• VCS integration support
• debugging and profiling
• project management
• Qt help integration
• powerful code editor
• examples and tutorials
• build configuration and
management
3. QObject and QWidget
QObject - central class in Qt
• base for most Qt classes
• handles signals/slots
• keeps meta-data
• handles parent/child ownership
QWidget - base for all UI classes
• handles widgets positioning
• any widget can be a separate window
• handles UI events (mouse, keyboard etc)
• can be simply ported to any platform thanks to Lighthouse
4. Parent/child ownership
The problem:
• make complex object's lifetime control transparent for
developer
• prevent memory leaks and referencing deleted objects
• prevent removing button while windows still visible
The solution:
• each QObject may have a parent QObject
• parent object knows its children and vice-versa
• parent removes its children
• parent widget draws its children inside itself
5. Copy-on-write
The problem:
• containers copying is usually expensive
• working with pointers is inconvenient
• working with const references decreases readability
The solution:
• many Qt classes share internal data between object
copies
• as soon as some object is changed, internal data are
copied to prevent changing all objects
6. Signals/slots
• QObjects may emit signals
• QObject's void method may be marked as slots
• Signals and slots may be connected many-to-many.
Benefits:
• simple way of communication between objects
• objects don't know about each other (no interfaces)
• perfectly works in multithreading application
• slot call can be queued for async execution
• connections can be easily managed in run-time
• no configuration needed, just subclass QObject
• works across C++, Javascript, QML
7. Qt meta-system
• powered by MOC
• stores information about QObject memebers
• provides a way to call object method by name
• empowers signals/slots mechanism
• available via QMetaObject, QMetaProperty,
QMetaMethod, QMetaEnum classes
• empowers Javascript, QML, plugins
• make it possible to have WYSIWYG designer
• highly extensible
8. Out of scope
• Model/View architecture in Qt
• Styling Qt applications
• Animation in Qt applications
• Qt Javascript engine
• Qt plugins system
• New Qt ports coming: WinRT, Android, iOS
• Bindings: PyQt, RubyQt, Qt Jambi and more...
• Mobile programming
• Declarative programming with QtQuick