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. Why QHash::iterator's operator+() was declared obsolet in 5.15?
Forum Updated to NodeBB v4.3 + New Features

Why QHash::iterator's operator+() was declared obsolet in 5.15?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 215 Views
  • 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.
  • K Offline
    K Offline
    Kofr
    wrote on last edited by
    #1

    And how to substitute correctly?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #2

      You can check the documentation yourself:
      https://doc.qt.io/qt-5/qhash-iterator-obsolete.html#operator-2b

      This operator is deprecated in order to align with std::unordered_map functionality.

      So I don't think there is any substitution since this function is removed on purpose.
      I think they just want to disable all the "backward" iterating functions of QHash (operator+() accepts negative values).
      You can use QMap instead, or calling operator++() multiple times, as what operator+() with a positive value actually does..

      1 Reply Last reply
      2
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        The function simply makes no sense - QHash is unordered so what do you want from this operator?

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        4

        • Login

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