Results 1 to 5 of 5

Thread: position of an item in a QStringList

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: position of an item in a QStringList

    Quote Originally Posted by jaca View Post
    The position of SPNT change depending on the file. How do I set a start if I do not know where the SPNT will appear in another file?
    There are many ways to do that, really. Here's pseudo code to go through all the instances of 'SPNT' in a string list.
    Qt Code:
    1. from = 0
    2. index = 0
    3. while ( index = strlist.indexOf('SPNT', from) != -1 )
    4. ...
    5. from = index
    6. endwhile
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by jaca View Post
    Actually I have a file like this:
    ...
    And I put it in this format:
    ...
    There must be an easier way that my.
    Why don't you read it line by line and insert VELF in the beginning of line where the line doesn't start with SPNT?
    J-P Nurmi

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

    jaca (29th May 2008)

Similar Threads

  1. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 08:37
  2. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 18:48
  3. Replies: 1
    Last Post: 19th April 2007, 23:23
  4. How to get a position of the menu bar item?
    By Mad Max in forum Qt Programming
    Replies: 2
    Last Post: 20th November 2006, 04:20
  5. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 02:34

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.