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

Permanent widgets in the status bar

Sometimes, we want a sort of indicator inside the status bar to display real-time status, such as the camera status. This is inappropriate if it's covered by temporary messages. In such a case, QStatusBar provides the insertPermanentWidget function to add a widget to the status bar permanently. It means that it won't be obscured by temporary messages and is located on the far right of the status bar.

Firstly, let's make a camera status widget. Add a new C++ class named CameraStatusWidget that inherits from QWidget, but use QLabel as the base class. We use QLabel as the base class because the status of the camera is displayed in text and is basically a customized label widget. The camerastatuswidget.h content ...

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