2

I have a class

class Window: public QMainWindow {
    // ...

private:
    Ui::MainWindow ui; 
}

Where Ui::MainWindow is the auto generated ui_mainwindow.h for the mainwindow.ui form. In my constructor

Window::Window(QWidget *parent):
    QMainWindow(parent)
{
    ui.setupUi(this);
    ui.retranslateUi(this);
    ui.statusbar->message(tr("Hello"), 3000); // here is the error
}

It says message could not be resolved.. So how can I set a temporary status here?

Dewsworld
  • 13,367
  • 23
  • 68
  • 104

2 Answers2

2

ui.statusbar->showMessage(tr("Hello"), 3000); // here is the error

Chris Browet
  • 4,156
  • 20
  • 17
1

it's void QStatusBar::showMessage ( const QString & message, int timeout = 0 ). Not only message

andrea.marangoni
  • 1,499
  • 8
  • 22