'QList' does not name a type
I m writing a function in which I take QList<QString> as argument and after manipulating returns the same.
Code:
//Header File
#include <QtGui/QMainWindow>
#include <qlist.h>
#include <string.h>
{
Q_OBJECT
public:
~MainWindow();
QList GetArray
(QList<QString> final
);
};
//Source file
QList<QString> MainWindow
::GetArray(QList final
){
QList<QString> finalList;
//finalList manipulating code
return finalList;
}
but when I compile ,it gives me following errors
Code:
In file included from mainwindow.cpp:1:
mainwindow.
h:49: error
: `
QList' does not name a typemainwindow.cpp: At global scope:
mainwindow.cpp:338: error: `QList<QString> MainWindow::GetArray' is not a static
member of `class MainWindow'
mainwindow.cpp:338: error: missing template arguments before "final"
mainwindow.cpp:339: error: expected `,' or `;' before '{' token
mingw32-make[1]: *** [tmp/obj/debug_shared/mainwindow.o] Error 1
mingw32-make[1]: Leaving directory `D:/Qt/4.4.3/examples/widgets/ASystem'
mingw32-make: *** [debug-all] Error 2
Re: 'QList' does not name a type
it has to be
Code:
QList<QString> MainWindow::GetArray(QList<QString> final)
or you use QStringList.
Re: 'QList' does not name a type
try
Code:
#include <QString>
#include <QList>
Re: 'QList' does not name a type
QList<QString> MainWindow::GetArray(QList<QString> final)
worked !!!! thaanx