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. [Solved, Moved] More memory needed?
Forum Updated to NodeBB v4.3 + New Features

[Solved, Moved] More memory needed?

Scheduled Pinned Locked Moved General and Desktop
11 Posts 4 Posters 4.0k 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.
  • A Offline
    A Offline
    andre
    wrote on last edited by
    #2

    No, it is probably just an off by one error in you accessing your QList.

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

      @
      while (j < listaGenerale.length())
      {
      if(listaGenerale.at(j).contains(".mp3"))
      listaFileMusicali.append("E:/Attachments/" + listaGenerale.at(j));
      qDebug()<<listaFileMusicali.at(j); // think about this line, especially when
      // listaGenerale.at(j).contains(".mp3") is false
      j++;
      }
      @

      What makes you think that "index out of range" does indicate a insufficient memory problem, and not an out of range index?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        spode
        wrote on last edited by
        #4

        nothing:
        @
        listaGenerale = dir.entryList();
        while (j < listaGenerale.length())
        {
        if(listaGenerale.at(j).contains(".mp3"))
        {
        listaFileMusicali.append(listaGenerale.at(j));
        qDebug()<<listaFileMusicali.at(j);
        }
        j++;
        }
        @

        @
        Launched.
        [Qt Message] "01 - An Deiner Seite (Radio Version) - Unheilig.mp3"
        [Qt Message] "012-peter_fox_-alles_neu-ministry.mp3"
        [Qt Message] "12-peter_fox
        -zucker(feat._vanessa_mason)-ysp.mp3"
        [Qt Message] "153 andrea bocheli & laura pausini - vivo por ella.mp3"
        [Qt Message] "21 guns.mp3"
        [Qt Message] "21st Century Breakdown.mp3"
        [Qt Message] ASSERT failure in QList<T>::at: "index out of range", file /QtSDK/Symbian/SDKs/Symbian1Qt473/include/QtCore/qlist.h, line 456
        Thread has crashed: Thread 0x20c has panicked. Category: ASSERT failure i; Reason: 0
        The device 'Nokia C5-03 USB Serial Port (COM9)' has been disconnected.
        @

        and in fact next file does not contain ".mp3"

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #5

          By all means it is not a good idea to use the same index j for different things. And that is what you are doing. If you have a list with 10 elements and you copy five of them into another list, how many elements will have you in the list?

          This should work
          @
          listaGenerale = dir.entryList();
          while (j < listaGenerale.length())
          {
          if(listaGenerale.at(j).contains(".mp3"))
          {
          listaFileMusicali.append(listaGenerale.at(j));
          qDebug()<<listaGenerale.at(j);
          }
          j++;
          }
          @

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            spode
            wrote on last edited by
            #6

            that is perfect! =) but do you know, you copied my code? =P

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #7

              Yes, I did copy your code from the post above my post. Hope it does not create a copyright issue :D

              However, you might want to have a close look for the important modification I did.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • S Offline
                S Offline
                spode
                wrote on last edited by
                #8

                ahahah! =D

                @

                listaGenerale = dir.entryList();
                while (j < listaGenerale.length())
                {
                if(listaGenerale.at(j).contains(".mp3"))
                {
                listaFileMusicali.append(listaGenerale.at(j));
                qDebug()<<listaGenerale.at(j);
                }
                j++;
                }
                @
                i hope it is right! ;)

                EDIT: Damn, it is not right. it persists to throw the same error: [Qt Message] ASSERT failure in QList<T>::at: "index out of range", file /QtSDK/Symbian/SDKs/Symbian1Qt473/include/QtCore/qlist.h, line 456 (working on symbian)

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #9

                  Hope you still have this statement as in your original post
                  @
                  register int j = 0;
                  @
                  respectively you might want to leave out the register statement and write
                  @
                  int j = 0;
                  @

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    spode
                    wrote on last edited by
                    #10

                    all right now. the problem was the increase of a variable!

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andre
                      wrote on last edited by
                      #11

                      Best way to solve these issues: make sure that you know the relevant values. Just step through the procedure with your debugger, and watch what happens. Or, perhaps just insert a bunch of qDebug() statements to print out the values of everything you touch in that piece of code. I think it would have been very easy to track this issue this way.

                      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