Solved function returns a struct
-
Hi all,
I have a function which returns a struct:
So I initialized this in the
.h
file:struct Model { QVector<int> values; }; Model getModelFromFile(QString path);
the fucntion defintion as:
Model MainWindow::getModelFromFile(QString path) { Model ret; ... return ret; }
this gives me error:
mainwindow.cpp:36:2: error: unknown type name 'Model'; did you mean 'MainWindow::Model'? mainwindow.h:21:16: note: 'MainWindow::Model' declared here
someone help me to find issue here?
-
@viniltc said in function returns a struct:
Model MainWindow::getModelFromFile(QString path) {
Should be:
MainWindow::Model MainWindow::getModelFromFile(QString path) {
-
@sierdzio Thanks a lot :)