SlideShare a Scribd company logo
1 of 8
Advanced Qt
•   Qt Creator IDE
•   Signals/Slots mechanism
•   Qt meta-system
•   Parent/child ownership
•   Copy-on-write
•   Bonus
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
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
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
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
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
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
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

More Related Content

Viewers also liked

cpp-2013 #12 Управління пам’яттю Частина 2
cpp-2013 #12 Управління пам’яттю Частина 2cpp-2013 #12 Управління пам’яттю Частина 2
cpp-2013 #12 Управління пам’яттю Частина 2
Amazon Web Services
 
cpp-2013 #11 Constness and Exceptions
cpp-2013 #11 Constness and Exceptionscpp-2013 #11 Constness and Exceptions
cpp-2013 #11 Constness and Exceptions
Amazon Web Services
 
Import,export procedure
Import,export procedureImport,export procedure
Import,export procedure
rishnrish
 
Export procedure
Export procedureExport procedure
Export procedure
Jay Parekh
 
EXPORT PROCEDURE & DOCUMENTATION
EXPORT PROCEDURE & DOCUMENTATIONEXPORT PROCEDURE & DOCUMENTATION
EXPORT PROCEDURE & DOCUMENTATION
vikas chauhan
 
Import & export presentation
Import & export presentationImport & export presentation
Import & export presentation
Eric Lee
 
A PROJECT REPORT ON EXPORT PROCESS AND DOCUMENTATION
A PROJECT REPORT ON EXPORT PROCESS AND DOCUMENTATIONA PROJECT REPORT ON EXPORT PROCESS AND DOCUMENTATION
A PROJECT REPORT ON EXPORT PROCESS AND DOCUMENTATION
Sagar Anand
 

Viewers also liked (16)

cpp-2013 #4 Memory management
cpp-2013 #4 Memory managementcpp-2013 #4 Memory management
cpp-2013 #4 Memory management
 
cpp-2013 #12 Управління пам’яттю Частина 2
cpp-2013 #12 Управління пам’яттю Частина 2cpp-2013 #12 Управління пам’яттю Частина 2
cpp-2013 #12 Управління пам’яттю Частина 2
 
cpp-2013 #16 Automated testing
cpp-2013 #16 Automated testingcpp-2013 #16 Automated testing
cpp-2013 #16 Automated testing
 
cpp-2013 #11 Constness and Exceptions
cpp-2013 #11 Constness and Exceptionscpp-2013 #11 Constness and Exceptions
cpp-2013 #11 Constness and Exceptions
 
cpp-2013 #20 Best practices
cpp-2013 #20 Best practicescpp-2013 #20 Best practices
cpp-2013 #20 Best practices
 
cpp-2013 #17 Libraries
cpp-2013 #17 Librariescpp-2013 #17 Libraries
cpp-2013 #17 Libraries
 
High Availability Application Architectures in Amazon VPC (ARC202) | AWS re:I...
High Availability Application Architectures in Amazon VPC (ARC202) | AWS re:I...High Availability Application Architectures in Amazon VPC (ARC202) | AWS re:I...
High Availability Application Architectures in Amazon VPC (ARC202) | AWS re:I...
 
Aspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETAspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NET
 
Export management ppt
Export management pptExport management ppt
Export management ppt
 
Import,export procedure
Import,export procedureImport,export procedure
Import,export procedure
 
Export procedure
Export procedureExport procedure
Export procedure
 
EXPORT PROCEDURE & DOCUMENTATION
EXPORT PROCEDURE & DOCUMENTATIONEXPORT PROCEDURE & DOCUMENTATION
EXPORT PROCEDURE & DOCUMENTATION
 
Export Procedures and Documents
Export Procedures and DocumentsExport Procedures and Documents
Export Procedures and Documents
 
Import & export presentation
Import & export presentationImport & export presentation
Import & export presentation
 
A PROJECT REPORT ON EXPORT PROCESS AND DOCUMENTATION
A PROJECT REPORT ON EXPORT PROCESS AND DOCUMENTATIONA PROJECT REPORT ON EXPORT PROCESS AND DOCUMENTATION
A PROJECT REPORT ON EXPORT PROCESS AND DOCUMENTATION
 
EXPORT IMPORT
EXPORT IMPORTEXPORT IMPORT
EXPORT IMPORT
 

Similar to cpp-2013 #18 Qt Part 2

Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
Daker Fernandes
 
下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development
csdnmobile
 

Similar to cpp-2013 #18 Qt Part 2 (20)

Qt programming-using-cpp
Qt programming-using-cppQt programming-using-cpp
Qt programming-using-cpp
 
Qt Application Programming with C++ - Part 1
Qt Application Programming with C++ - Part 1Qt Application Programming with C++ - Part 1
Qt Application Programming with C++ - Part 1
 
Qt Qml
Qt QmlQt Qml
Qt Qml
 
Qt for S60
Qt for S60Qt for S60
Qt for S60
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
 
QtQuick Day 1
QtQuick Day 1QtQuick Day 1
QtQuick Day 1
 
Qt Automotive Suite - under the hood // Qt World Summit 2017
Qt Automotive Suite - under the hood // Qt World Summit 2017Qt Automotive Suite - under the hood // Qt World Summit 2017
Qt Automotive Suite - under the hood // Qt World Summit 2017
 
Archipel Introduction - ejabberd SF Meetup
Archipel Introduction - ejabberd SF MeetupArchipel Introduction - ejabberd SF Meetup
Archipel Introduction - ejabberd SF Meetup
 
Cutest technology of them all - Forum Nokia Qt Webinar December 2009
Cutest technology of them all - Forum Nokia Qt Webinar December 2009Cutest technology of them all - Forum Nokia Qt Webinar December 2009
Cutest technology of them all - Forum Nokia Qt Webinar December 2009
 
下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development
 
Supercharge your IOT toolbox with MQTT and Node-RED
Supercharge your IOT toolbox with MQTT and Node-REDSupercharge your IOT toolbox with MQTT and Node-RED
Supercharge your IOT toolbox with MQTT and Node-RED
 
Qt quick (qml)
Qt quick (qml)Qt quick (qml)
Qt quick (qml)
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
Qt 5 - C++ and Widgets
Qt 5 - C++ and WidgetsQt 5 - C++ and Widgets
Qt 5 - C++ and Widgets
 
Mastercoin: Reinventing Finance
Mastercoin: Reinventing FinanceMastercoin: Reinventing Finance
Mastercoin: Reinventing Finance
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
 
Google web toolkit gwt training
Google web toolkit gwt trainingGoogle web toolkit gwt training
Google web toolkit gwt training
 

More from Amazon Web Services

More from Amazon Web Services (12)

cpp-2013 #19 Concurrency
cpp-2013 #19 Concurrencycpp-2013 #19 Concurrency
cpp-2013 #19 Concurrency
 
cpp-2013 #15 Databases
cpp-2013 #15 Databasescpp-2013 #15 Databases
cpp-2013 #15 Databases
 
cpp-2013 #14 Основи Qt
cpp-2013 #14 Основи Qtcpp-2013 #14 Основи Qt
cpp-2013 #14 Основи Qt
 
cpp-2013 #13 C++11
cpp-2013 #13 C++11cpp-2013 #13 C++11
cpp-2013 #13 C++11
 
cpp-2013 #9 STL Algorithms Part 1
cpp-2013 #9 STL Algorithms Part 1cpp-2013 #9 STL Algorithms Part 1
cpp-2013 #9 STL Algorithms Part 1
 
cpp-2013 #8 STL Containers Part 2
cpp-2013 #8 STL Containers Part 2cpp-2013 #8 STL Containers Part 2
cpp-2013 #8 STL Containers Part 2
 
cpp-2013 #7 Templates and STL Containers
cpp-2013 #7 Templates and STL Containerscpp-2013 #7 Templates and STL Containers
cpp-2013 #7 Templates and STL Containers
 
cpp-2013 #6 OOP Part 2
cpp-2013 #6 OOP Part 2cpp-2013 #6 OOP Part 2
cpp-2013 #6 OOP Part 2
 
cpp-2013 #5 File and network input/output
cpp-2013 #5 File and network input/outputcpp-2013 #5 File and network input/output
cpp-2013 #5 File and network input/output
 
cpp-2013 #3 OOP Basics
cpp-2013 #3 OOP Basicscpp-2013 #3 OOP Basics
cpp-2013 #3 OOP Basics
 
cpp-2013 #2 Organizing your code
cpp-2013 #2 Organizing your codecpp-2013 #2 Organizing your code
cpp-2013 #2 Organizing your code
 
cpp-2013 #1 C++ basics
cpp-2013 #1 C++ basicscpp-2013 #1 C++ basics
cpp-2013 #1 C++ basics
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

cpp-2013 #18 Qt Part 2

  • 1. Advanced Qt • Qt Creator IDE • Signals/Slots mechanism • Qt meta-system • Parent/child ownership • Copy-on-write • Bonus
  • 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