Don’t use the QMainWindow’s builtin QStatusBar (created and accessed using the statusBar() method.)
That status bar has problems on the OSX platform. In other words, while Qt is generally cross-platform, this particular status bar is not. But even if you don’t support that platform, its a bad idea…
That status bar is always at the bottom of the window. That’s bad because it constrains the user. Also its bad as UI because it divides the user’s attention among:
- the top of the window (the menubar)
- the bottom of the window (the statusbar)
- the middle of the window (where most action occurs
This is well known. The Apple HIG discusses it. Thats why the QMainWindow’s status bar is problematic on the OSX platform.
In the Apple HIG they call a status bar at the bottom of a window a Placard, and say:
Note: Placards are not recommended for use in apps that run in OS X v10.7 and later.
A status bar itself is not always a good idea, no matter where it is or how you implement it. See a discussion in the GUI Design Handbook.
But the status bar at the top of the screen is often a good idea on a phone: see the iOS HIG.
If you must have a status bar in a Qt app, a better approach is to put a QStatusBar widget as a child of the toolbar area of a QMainWindow. Briefly (in Python):
toolbar = mainWindow.addToolbar("Foo") statusBar = QStatusBar() toolbar.addWidget(statusBar)
- the user can move it (to any edge of the parent main window)
- the user can float it (to a separate window)
- tooltips for context menus go to it
while it still is a status bar in the sense “displays a running stream of status.”