Results 1 to 4 of 4

Thread: 'QList' does not name a type

  1. #1
    Join Date
    Mar 2009
    Posts
    116
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default '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.

    Qt Code:
    1. //Header File
    2.  
    3. #include <QtGui/QMainWindow>
    4. #include <qlist.h>
    5. #include <string.h>
    6.  
    7. class MainWindow : public QMainWindow
    8. {
    9.  
    10. Q_OBJECT
    11.  
    12. public:
    13. MainWindow(QWidget *parent = 0);
    14. ~MainWindow();
    15. QList GetArray(QList<QString> final);
    16. };
    17.  
    18.  
    19. //Source file
    20.  
    21. QList<QString> MainWindow::GetArray(QList final)
    22. {
    23. QList<QString> finalList;
    24. //finalList manipulating code
    25. return finalList;
    26.  
    27. }
    To copy to clipboard, switch view to plain text mode 

    but when I compile ,it gives me following errors

    Qt Code:
    1. In file included from mainwindow.cpp:1:
    2. mainwindow.h:49: error: `QList' does not name a type
    3. mainwindow.cpp: At global scope:
    4. mainwindow.cpp:338: error: `QList<QString> MainWindow::GetArray' is not a static
    5. member of `class MainWindow'
    6. mainwindow.cpp:338: error: missing template arguments before "final"
    7. mainwindow.cpp:339: error: expected `,' or `;' before '{' token
    8. mingw32-make[1]: *** [tmp/obj/debug_shared/mainwindow.o] Error 1
    9. mingw32-make[1]: Leaving directory `D:/Qt/4.4.3/examples/widgets/ASystem'
    10. mingw32-make: *** [debug-all] Error 2
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: 'QList' does not name a type

    it has to be
    Qt Code:
    1. QList<QString> MainWindow::GetArray(QList<QString> final)
    To copy to clipboard, switch view to plain text mode 
    or you use QStringList.

  3. #3
    Join Date
    Dec 2008
    Location
    TaganrogNativelandChehov,Russia
    Posts
    64
    Thanks
    1
    Thanked 8 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: 'QList' does not name a type

    try
    Qt Code:
    1. #include <QString>
    2. #include <QList>
    To copy to clipboard, switch view to plain text mode 
    east or west home is best

  4. #4
    Join Date
    Mar 2009
    Posts
    116
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: 'QList' does not name a type

    QList<QString> MainWindow::GetArray(QList<QString> final)


    worked !!!! thaanx

Similar Threads

  1. error compiling for QtCppIntegration
    By mzeal in forum Qwt
    Replies: 1
    Last Post: 5th January 2012, 08:25
  2. QList, copy problems
    By Valheru in forum Qt Programming
    Replies: 4
    Last Post: 5th February 2010, 00:06
  3. Convert between a custom data type wrapped in a QVariant
    By darkadept in forum Qt Programming
    Replies: 2
    Last Post: 17th March 2009, 09:07
  4. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  5. dummy question(Error)
    By Masih in forum Qt Programming
    Replies: 12
    Last Post: 19th July 2007, 23:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.