I created a QMainWindow using QT Designer.
As we know, it has statusBar by default.
By default, QT Designer gave its objectname as "statusBar".
Now, when I tried to call like:-
statusBar()->showMessage(tr("File successfully loaded."), 3000);
as we have a function with prototype: QStatusBar * QMainWindow::statusBar () const
The Compiler shows the error:-
>error: reference to ‘statusBar’ is ambiguous.
>error: candidates are: QStatusBar* Ui_MainWindow::statusBar
>error: QStatusBar*QMainWindow::statusBar() const
Actually, i was following a book "The Art of Building Qt Applications by DANIEL MOLKENTIN". And I am compiling the same code given in book.
Is this a bug in QT4??
Bookmarks