Results 1 to 9 of 9

Thread: how to split the text in Qstringlist

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to split the text in Qstringlist

    Split each filename according to what criteria?
    I think you and the OP are interpreting the word "split" differently. If he wants to display each file in the list, then it makes no sense at all to split the file names into smaller pieces.

    I think he just doesn't understand how to retrieve the individual file names from the list.

    Qt Code:
    1. QString fileName;
    2. foreach( fileName, dirList )
    3. {
    4. // "fileName" now contains the name of one of the files in the list
    5. // Use QPixmap to read the image from the file
    6. // Use QLabel::setPixmap() to display the pixmap on a QLabel (for example)
    7. // or use QGraphicsPixmapItem to show it in a QGraphicsScene (for example)
    8. }
    To copy to clipboard, switch view to plain text mode 

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

    iswaryasenthilkumar (16th February 2015)

Similar Threads

  1. Replies: 7
    Last Post: 6th February 2017, 19:10
  2. Memory used to store text in QStringList.
    By jesse_mark in forum Qt Programming
    Replies: 6
    Last Post: 25th August 2014, 07:46
  3. Split string
    By mero in forum Qt Programming
    Replies: 3
    Last Post: 19th March 2011, 19:17
  4. split a QTabWidget?
    By shud in forum Qt Programming
    Replies: 1
    Last Post: 15th July 2009, 19:56
  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.