Dewsworld
Dewsworld

Reputation: 14063

Qt cant load temporary status message

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?

Upvotes: 2

Views: 97

Answers (2)

Chris Browet
Chris Browet

Reputation: 4276

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

Upvotes: 2

andrea.marangoni
andrea.marangoni

Reputation: 1499

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

Upvotes: 1

Related Questions