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:
- Go back to the
MainWindow
class. - Edit the
mainwindow.ui
file in the Design mode. - Drag Push Button and rename it as
newDownloadButton
withNew Download
as its text. - Drag Progress Bar just beneath
newDownloadButton
. - Change the layout to Lay Out Vertically.
- Uncheck
textVisible
in theprogressBar
widget's ...
Get Qt 5 Blueprints now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.