Results 1 to 3 of 3

Thread: Cannot queue arguments of type 'QStringList'

  1. #1
    Join Date
    Jan 2006
    Location
    Innsbruck, Austria
    Posts
    62
    Thanks
    10
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Cannot queue arguments of type 'QStringList'

    With QT 4.1, I'm trying to connect a signal from a worker thread (child of QThread) to a slot in a class which is a child of QWidget and pass a QStringList as the argument:

    Qt Code:
    1. connect(m_workerThread, SIGNAL(setSystemUserNames(const QStringList&)),
    2. this, SLOT(setSystemUserNames(const QStringList&)));
    To copy to clipboard, switch view to plain text mode 

    But when I run the program I get this error message and the connection isn't established:

    QObject::connect: Cannot queue arguments of type 'QStringList'
    Both methods in m_workerThread and the GUI class are defined as:

    Qt Code:
    1. void setSystemUserNames(const QStringList& userNames);
    To copy to clipboard, switch view to plain text mode 

    I've tried changing it to simply "QStringList userNames" (so, not const&), but still get the same warning. Am I missing something? Any idea?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cannot queue arguments of type 'QStringList'

    Try:
    Qt Code:
    1. qRegisterMetaType<QStringList>("QStringList");
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Cannot queue arguments of type 'QStringList'

    or use QVariant holding a list (QVariant(QStringList)) instead of QStringList.

Similar Threads

  1. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 14:43
  2. QObject::connect: Cannot queue arguments of type 'QString&'
    By Dumbledore in forum Qt Programming
    Replies: 3
    Last Post: 9th November 2007, 23:15
  3. Replies: 6
    Last Post: 21st September 2007, 14:51
  4. dummy question(Error)
    By Masih in forum Qt Programming
    Replies: 12
    Last Post: 20th July 2007, 00: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.