Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QMap or QHash
Qt 6.11 is out! See what's new in the release blog

QMap or QHash

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 5.8k 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
    Abhishek2509
    wrote on last edited by
    #1

    Which is bettter of option to use between QMap or QHash? Or tell me condition where QMap / QHash is usefull.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      QHash is faster when there is more than 8 elements in the container.

      QMap is sorted so prefer it if you need ordered keys/ values. QML has better support for maps (QVariantMap and the like).

      Other than that they are practically identical from user perspective.

      (Z(:^

      A 1 Reply Last reply
      5
      • sierdzioS sierdzio

        QHash is faster when there is more than 8 elements in the container.

        QMap is sorted so prefer it if you need ordered keys/ values. QML has better support for maps (QVariantMap and the like).

        Other than that they are practically identical from user perspective.

        A Offline
        A Offline
        Abhishek2509
        wrote on last edited by
        #3

        @sierdzio thanks man

        jsulmJ 1 Reply Last reply
        0
        • A Abhishek2509

          @sierdzio thanks man

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Abhishek2509 https://doc.qt.io/qt-5/containers.html

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2

          • Login

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