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
QT5 Blueprints

You're reading from   QT5 Blueprints Design, build, and deploy cross-platform GUI projects using the amazingly powerful Qt 5 framework

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781784394615
Length 272 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Symeon Huang Symeon Huang
Author Profile Icon Symeon Huang
Symeon Huang
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Creating Your First Qt Application FREE CHAPTER 2. Building a Beautiful Cross-platform Clock 3. Cooking an RSS Reader with Qt Quick 4. Controlling Camera and Taking Photos 5. Extending Paint Applications with Plugins 6. Getting Wired and Managing Downloads 7. Parsing JSON and XML Documents to Use Online APIs 8. Enabling Your Qt Application to Support Other Languages 9. Deploying Applications on Other Devices 10. Don't Panic When You Encounter These Issues Index

Creating a basic digital clock

It's time to create a new project, so we will create a Qt Widgets application named Fancy_Clock.

Note

We won't utilize any Qt Quick knowledge in this chapter.

Now, change the window title to Fancy Clock or any other name that you like. Then, the main window UI needs to be tailored because the clock is displayed at the top of the desktop. The menu bar, status bar, and toolbar are all removed. After that, we need to drag an LCD Number widget into centralWidget. Next, change the layout of MainWindow to LayOut Horizontally in order to autoresize the subwidget. The last thing that needs to be done to the UI file is to change frameShape to NoFrame under the QFrame column in the property of lcdNumber. If you've done this right, you'll get a prototype of a digital clock, as shown here:

Creating a basic digital clock

In order to update the LCD number display repeatedly, we have to make use of the QTimer class to set up a timer that emits a signal repetitively. In addition to this...

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 $19.99/month. Cancel anytime