Results 1 to 3 of 3

Thread: QStringlist problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QStringlist problem

    There is a return missing in your getDeviceInfoList(), when the if condition is not met.
    Just return QStringList()

    And you need to check the returned list before attempting access by index.

    Something like
    Qt Code:
    1. const QStringList deviceInfos = m_D2xxport->getDeviceInfoList();
    2. if (!deviceInfos.isEmpty() && m_D2xxport->PortConfiguration( deviceInfos.at(0).... )
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    anh5kor (28th November 2014)

  3. #2
    Join Date
    Oct 2014
    Posts
    71
    Thanks
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QStringlist problem

    Thanks anda_skoa for the solution .it's working for my code...

Similar Threads

  1. qDebug / qStringList - Problem
    By EMKAH in forum Newbie
    Replies: 5
    Last Post: 19th November 2012, 16:50
  2. QStringList problem :/
    By hakermania in forum Qt Programming
    Replies: 9
    Last Post: 17th August 2010, 13:55
  3. qstringlist problem
    By stella1016 in forum Qt Programming
    Replies: 4
    Last Post: 17th December 2009, 09:16
  4. problem clear QStringList
    By jaca in forum Newbie
    Replies: 4
    Last Post: 30th May 2008, 16:10
  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
  •  
Qt is a trademark of The Qt Company.