Qt5 to Qt6 porting
-
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
-
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.
-
I used something like this:
QStyleOptionViewItem option; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) initViewItemOption(&option); #else option = viewOptions(); #endif
-
@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.
-
@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!
-
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
-
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.