So, I want to create a "recent files" section in the "File menu" of my spreadsheet application. While building the application, the function that is supposed to update the recentFileActions QStringList generates the following error/home/axel/QtSDK/Code/QMainWindow/mainwindow.cpp:-1: error: undefined reference to 'MainWindow::recentFiles'
So from the error I get that recentFiles isn't defined? Because I have this in the private section of my header: QStringList static recentFiles;
This is the whole updateRecentFileActions() function:
void MainWindow::updateRecentFileActions(){ QMutableStringListIterator i(recentFiles); while (i.hasNext()) { if (!QFile::exists(i.next())) i.remove(); } for (int j = 0; j < MaxRecentFiles; ++j) { if (j < recentFiles.count()) { QString text = tr("&%1 %2") .arg(j + 1) .arg(strippedName(recentFiles[j])); recentFileActions[j]->setText(text); recentFileActions[j]->setData(recentFiles[j]); recentFileActions[j]->setVisible(true); } else { recentFileActions[j]->setVisible(false); } } separatorAction->setVisible(!recentFiles.isEmpty()); } I'll add any missing information.
Thank you.