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. Maximum size of QList.
Forum Updated to NodeBB v4.3 + New Features

Maximum size of QList.

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

    Hi,

    Does somebody know how many elements can be inserted to QList? Are some relations between the size of an element and number of elements? I cannot find it in the documentation.

    Best regards,
    Grzegorz

    kshegunovK 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The maximum number of element is the maximal value of a signed int on your platform.

      Out of curiosity, why would you need that many elements ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      VRoninV 1 Reply Last reply
      4
      • SGaistS SGaist

        Hi,

        The maximum number of element is the maximal value of a signed int on your platform.

        Out of curiosity, why would you need that many elements ?

        VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        @SGaist said in Maximum size of QList.:

        The maximum number of element is the maximal value of a signed int on your platform.

        Unless you have a monster of a machine you'll probably run out of memory before you reach this limit so I'd say the real limit is the amount of RAM

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        3
        • GrzegorzG Grzegorz

          Hi,

          Does somebody know how many elements can be inserted to QList? Are some relations between the size of an element and number of elements? I cannot find it in the documentation.

          Best regards,
          Grzegorz

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          Also, if your type isn't the size of void * then you're better off using QVector or one of the STL containers.

          Read and abide by the Qt Code of Conduct

          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