First, greetings to all. I just initiated in Qt 4.3.4. and I have been following the tutorial that accompanies the installation 'addressbook'. I have scrupulously followed all the steps but when I arrive while adding this code:
if (dialog.exec()) {
if (!name.isEmpty() && !email.isEmpty()) {
item->setData(Qt::UserRole, email);
ui.addressList->setCurrentItem(item);
}
}
if (dialog.exec()) {
QString name = dialog.name();
QString email = dialog.email();
if (!name.isEmpty() && !email.isEmpty()) {
QListWidgetItem *item = new QListWidgetItem(name, ui.addressList);
item->setData(Qt::UserRole, email);
ui.addressList->setCurrentItem(item);
}
}
To copy to clipboard, switch view to plain text mode
to compile, I get the errors:
`QListWidgetItem' undeclared (first use this function)
`QListWidgetItem' has not been declared
`item' undeclared (first use this function)
What is that? Do the tutorial has mistakes or I who is wrong? I appreciate any clarification to my question. Thanks.
Bookmarks