Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. [SOLVED]QStringList index problem
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]QStringList index problem

Scheduled Pinned Locked Moved Brainstorm
3 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LargoPlanet4
    wrote on last edited by
    #1

    Hello!

    I would like to ask for help.

    If I write follow code (gep_pakli is a QStringList), then I get an error during running:
    @kartya = gep_pakli.at(i);@

    but if I write follow code then running without error:
    @kartya = gep_pakli.at(3);@

    Why not working if I use (int) variable?

    Error:
    ASSERT failure in QList<T>::take: "index out of range", file /Users/ivanicsmark/Qt5.2.1/5.2.1/clang_64/lib/QtCore.framework/Headers/qlist.h, line 488

    (I use OS X, but I would like use on Windows later.)

    Thank you!

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clochydd
      wrote on last edited by
      #2

      Hi, it will work with an integer variable as well.
      Make sure, your variable has a content which is represented in your QList - you may want to test it with qDebug() << i;

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LargoPlanet4
        wrote on last edited by
        #3

        [quote author="Clochydd" date="1397405737"]Hi, it will work with an integer variable as well.
        Make sure, your variable has a content which is represented in your QList - you may want to test it with qDebug() << i;[/quote]

        It's working. The for loop is running 0-5, but the data for QStringList have 0-4.

        Thank you for helping!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved