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 ...

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.