I suggest you read the error messages again. The compiler is not issuing them out of spite: ui and model are not valid where you are trying to use them.
If your code actually looks like:
void rowClicked(const QModelIndex& ...) {
// E:\Bird\splash1\mainwindow.cpp:-1: In function 'void rowClicked(const QModelIndex&)':
// E:\Bird\splash1\mainwindow.cpp:181: error: 'model' was not declared in this scope
// E:\Bird\splash1\mainwindow.cpp:186: error: 'ui' was not declared in this scope
// E:\Bird\splash1\mainwindow.cpp:181: warning: unused variable 'id' [-Wunused-variable]
...
}
void rowClicked(const QModelIndex& ...) {
// E:\Bird\splash1\mainwindow.cpp:-1: In function 'void rowClicked(const QModelIndex&)':
// E:\Bird\splash1\mainwindow.cpp:181: error: 'model' was not declared in this scope
// E:\Bird\splash1\mainwindow.cpp:186: error: 'ui' was not declared in this scope
// E:\Bird\splash1\mainwindow.cpp:181: warning: unused variable 'id' [-Wunused-variable]
...
}
To copy to clipboard, switch view to plain text mode
then the issue is that rowClicked() is a free function and not part of the MainWindow class (i.e. void MainWindow::rowClicked()).
Bookmarks