Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Application Development with Qt Creator - Second Edition

You're reading from   Application Development with Qt Creator - Second Edition Design and build dazzling cross-platform applications using Qt and Qt Quick

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher Packt
ISBN-13 9781784398675
Length 264 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (15) Chapters Close

Preface 1. Getting Started with Qt Creator 2. Building Applications with Qt Creator FREE CHAPTER 3. Designing Your Application with Qt Designer 4. Qt Foundations 5. Developing Applications with Qt Widgets 6. Drawing with Qt 7. Doing More with Qt Quick 8. Multimedia and Qt Quick 9. Sensors and Qt Quick 10. Localizing Your Application with Qt Linguist 11. Optimizing Performance with Qt Creator 12. Developing Mobile Applications with Qt Creator 13. Qt Tips and Tricks Index

Your main application and its menus


In order to use Qt Widgets, you need to do two things. First, you need to ensure that you include the widgets module in your project by adding the following line in your project's .pro file:

QT += widgets

Second, any file using the Qt Widgets should include the QWidgets header as one of the headers. You might also need to include the header files for individual widgets, such as QButton, QMenuBar, and so forth:

#include <QWidgets>

Qt provides the QGuiApplication class (a subclass of QCoreApplication) to manage your application's life cycle, including the event loop required by today's GUI platforms. You've already seen QCoreApplication, which we used for our console application in the first chapter.

You probably won't do much with QGuiApplication, but there are two signals it offers that are good for you to know about; these are as follows:

  • It emits the applicationStateChanged signal when the application state changes, notifying you as to whether an application...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime