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. Qt5 to Qt6 porting

Qt5 to Qt6 porting

Scheduled Pinned Locked Moved Solved General and Desktop
qt6qt5.15.0
7 Posts 4 Posters 2.3k Views 2 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey!

    Sooo the time has come to port to Qt6... so how can I find functions/replacement functions for this mamoth task ?

    Atm I'm in QTreeView and viewOptions() option is now gone with no hint to what has replaced it...

    Can any1 hint me to how can I approach this task ?

    Is there any documentation that explains what was removed/replaced/how to handle new api ?

    TIA

    1 Reply Last reply
    0
    • jeremy_kJ Online
      jeremy_kJ Online
      jeremy_k
      wrote on last edited by
      #2

      https://doc.qt.io/qt-6/qabstractitemview.html#initViewItemOption

      It doesn't appear to have made it into the Qt 6 widgets changes documentation at https://doc.qt.io/qt-6/widgets-changes-qt6.html.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      0
      • Jonas KvingeJ Offline
        Jonas KvingeJ Offline
        Jonas Kvinge
        wrote on last edited by
        #3

        I used something like this:

        QStyleOptionViewItem option;
        #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
        initViewItemOption(&option);
        #else
        option = viewOptions();
        #endif
        
        1 Reply Last reply
        1
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Dariusz said in Qt5 to Qt6 porting:

          Is there any documentation that explains what was removed/replaced/how to handle new api ?

          Compile your program with Qt5.15, fix all deprecation warnings and it will properly compile with Qt6.

          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
          1
          • D Offline
            D Offline
            Dariusz
            wrote on last edited by
            #5

            @Jonas-Kvinge thanks! That looks good. Will work off that!

            @Christian-Ehrlicher Yeh my bad I was on 5.15.1 or something like that, but I must have missed that warning.

            All good danke all!

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

              In this case I was wrong since the new virtual function could not be added to 5.15 since this would break binary compatibility. There was only a changelog entry for it: https://codereview.qt-project.org/c/qt/qtbase/+/310416

              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
              2
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                A section to this change will be added in the next Qt6 version: https://codereview.qt-project.org/c/qt/qtbase/+/341841
                Thx for the hint.

                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
                2

                • Login

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