Results 1 to 4 of 4

Thread: QMAP<QString, QStringList>

  1. #1
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Post QMAP<QString, QStringList>

    Ihave
    QMap<QString, QStringList> m_mapTestcaseFileToIDs;

    QList<QStringList> testcaseID = m_mapTestcaseFileToIDs.values(tclFile);

    Its returning a list of stringlist.But this is actually should return only a QString.

    Here we need to use one more extra loop,
    Any solution to find the value easily.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMAP<QString, QStringList>

    I guess you wanted QMap::value

  3. #3
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QMAP<QString, QStringList>

    Ues i want to use QMap::value
    I tried for
    const QMap<QStringList, QString> abc = m_mapTestcaseFileToIDs.value(tclFile);

    But it is giving error that
    D:\FATT\Gui\MainWindow.cpp(1510) : error C2440: 'initializing' : cannot convert from 'const class QStringList' to 'class QMap<class QStringList,class QString>'
    No constructor could take the source type, or constructor overload resolution was ambiguous

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMAP<QString, QStringList>

    QMap<QString, QStringList> m_mapTestcaseFileToIDs;
    This says you have created a map based on QString . If you enter a QString, it will give the corresponding QStringList.
    You will have to do something like -
    QStringList list = m_mapTestcaseFileToIDs.value(tclFile);

  5. The following user says thank you to aamer4yu for this useful post:

    bismitapadhy (4th February 2010)

Similar Threads

  1. QStringlist To QString
    By phillip_Qt in forum Qt Programming
    Replies: 6
    Last Post: 19th June 2015, 14:17
  2. Replies: 1
    Last Post: 3rd August 2009, 12:44
  3. Replies: 0
    Last Post: 25th June 2009, 08:17
  4. Bring va_list args; to a QStringList or a qmap
    By patrik08 in forum General Programming
    Replies: 8
    Last Post: 18th June 2006, 12:31
  5. Replies: 7
    Last Post: 2nd June 2006, 12:48

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.