[Solved] setWindowTitle was not declared in this scope
I have a problem with the tutorial addressbook. I have spent quite some time trying to figure out what is wrong and I have searched the forum - without succes:
AddressBook::AddressBook(QWidget *parent) : QWidget(parent)
QLabel *nameLabel = new QLabel(tr("Name:"));
nameLine = new QLineEdit;
QLabel *addressLabel = new QLabel(tr("Address:"));
addressLine = new QTextEdit;
QGridLayout *mainLayout = new QGridLayout; mainLayout ->addWidget(nameLabel, 0, 0); mainLayout ->addWidget(nameLine, 0, 1); mainLayout ->addWidget(addressLabel, 1, 0, Qt::AlignTop); mainLayout ->addWidget(addressLine, 1, 1); setLayout(mainLayout); SetWindowTitle(tr("Simple Address Book"));
class AddressBook : public QWidget
AddressBook(QWidget *parent = 0);
#endif // ADDRESSBOOK_H
int main(int argc, char *argv)
QApplication app(argc, argv);
AddressBook addressBook; addressBook.show(); return app.exec();
I have checked with your coding and find no errors.
Can anyone help?
Welcome to devnet
You probably have seen the documentation of "setWindowTitle":http://developer.qt.nokia.com/doc/qt-4.8/qwidget.html#windowTitle-prop
It starts with a lower case letter. In your code listing above you start it with an upper case letter.
Man, that I coul'nt see that! Thanks a lot.
Please mark your thread as SOLVED.
marked as solved