1

I have this:

status=new QStatusBar(statusBar());
status->resize(MainWindow::size().width(), 10);
status->showMessage("Welcome!", 10);
status->show();

It does not show the message. However, it does show a tiny grip resizer. Why does it not display the message?

built1n
  • 1,518
  • 14
  • 25

1 Answers1

4

You're making this a child of the existing statusBar(), or NULL if there isn't one. Try passing in the main window as the parent, and then call the main window's setStatusBar() on it. You probably don't need the resize or show.

You can try this perhaps at the end of the main window's constructor:

QStatusBar* status = new QStatusBar(this);
status->showMessage("Welcome!", 10);
setStatusBar(status);
darron
  • 4,284
  • 3
  • 36
  • 44