O'Reilly logo

Qt 5 Blueprints by Symeon Huang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required