So I have a problem….
I’ve a method
void MainWindow::loadItems(const ArticleStore& store)
{
}
that I try to call like this inside the MainWindow class
ArticleStore store();
loadItems(store)
And I get this error
mainwindow.cpp:15: error: no matching function for call to ‘MainWindow::loadItems(ArticleStore (&)())’
mainwindow.h:19: note: candidates are: void MainWindow::loadItems(const ArticleStore&)
ArticleStore definition:
class ArticleStore
{
public:
ArticleStore();
};
So the question is what went wrong?
It’s because
is interpreted by the compiler as a function declaration.
That’s explain why compiler is looking for
‘MainWindow::loadItems(ArticleStore (&)())’You must write instead: