Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying QT5 Blueprints
  • Table Of Contents Toc
QT5 Blueprints

QT5 Blueprints

By : Symeon Huang
4 (9)
close
close
QT5 Blueprints

QT5 Blueprints

4 (9)
By: Symeon Huang

Overview of this book

If you are a programmer looking for a truly cross-platform GUI framework to help you save your time by side-stepping the incompatibility between different platforms and building applications using Qt 5 for multiple targets, then this book is most certainly intended for you. It is assumed that you have a basic programming experience of C++ and fundamental knowledge about Qt.
Table of Contents (12 chapters)
close
close
11
Index

Making use of the progress bar


An intuitive way to indicate the downloading progress is by using a progress bar. In Qt, it is the QProgressBar class that provides a horizontal or vertical progress bar widget. It uses minimum, value, and maximum to determine the completed percentage. The percentage is calculated by the formula, (value – minimum) / (maximum – minimum). We'll use this useful widget in our example application by performing the following steps:

  1. Go back to the MainWindow class.

  2. Edit the mainwindow.ui file in the Design mode.

  3. Drag Push Button and rename it as newDownloadButton with New Download as its text.

  4. Drag Progress Bar just beneath newDownloadButton.

  5. Change the layout to Lay Out Vertically.

  6. Uncheck textVisible in the progressBar widget's property.

The push button, newDownloadButton, is used to popup DownloadDialog to get a new download task. We need to apply some modifications to mainwindow.h, as suggested here:

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
QT5 Blueprints
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon