Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Runtime Error what to do?
Forum Updated to NodeBB v4.3 + New Features

Runtime Error what to do?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.2k 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.
  • M Offline
    M Offline
    mark_ua_1999
    wrote on last edited by
    #1

    Hi, i have got the following problem ASSERT: "i >= 0" in file ........\5.3\mingw482_32\include/QtCore/qstring.h, line 1023 in my qt program do you have any ideas how to resolve it thanks0_1511193489311_Capture.PNG

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      You most likely does something like

      QString str;
      str[X]
      where X is bigger than string is or string is empty.

      Use the debugger to spot the location.

      aha_1980A 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        You most likely does something like

        QString str;
        str[X]
        where X is bigger than string is or string is empty.

        Use the debugger to spot the location.

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by aha_1980
        #3

        @mrjj said in Runtime Error what to do?:

        Hi
        You most likely does something like

        QString str;
        str[X]
        where X is bigger than string is or string is empty.

        You're right, the index is out of bounds. but from the assert I guess that X is smaller than zero (X<0) :)

        EDIT: X may be used uninitialized

        Qt has to stay free or it will die.

        mrjjM 1 Reply Last reply
        3
        • aha_1980A aha_1980

          @mrjj said in Runtime Error what to do?:

          Hi
          You most likely does something like

          QString str;
          str[X]
          where X is bigger than string is or string is empty.

          You're right, the index is out of bounds. but from the assert I guess that X is smaller than zero (X<0) :)

          EDIT: X may be used uninitialized

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @aha_1980
          Yeah, good catch , it seems to say assert for >=0 fail so
          it most likely negative index.

          1 Reply Last reply
          1

          • Login

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