-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Add support for Qt6 #2557
Conversation
… it should cast to time_t safely until year 2106
…st/conversion to better digest them cast
…rExpression Method str_kvs_fnc_split() had to be replaced with the original version, since the newer one relied on Qt5's QStringRef
…h qt integer types
…ctor since it creates ambiguity with the previous
QFont changed the weight scale in Qt6, in order to use them we'd need to fix all configuration files in all themes. QStreamConverter only supports Utf8/16/32 and Latin1 before Qt6.5. Stick to qt5compat's QTextCodec by now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can easily require Qt6.5+ for the Qt6 build, that shouldn't be a problem, I think
set(qt5_kvirc_modules) | ||
# first check if Qt6 or Qt5 has to be used | ||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) | ||
# second, detect available modules for the specific Qt version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do both components in the same find_package? COMPONENTS Core Widgets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first call is only used to determine if Qt5 or Qt6 will be used, and define ${QT_VERSION_MAJOR}
accordingly.
All the other calls force the specific Qt version using find_package(Qt${QT_VERSION_MAJOR} ..)
.
This way of support both Qt5 and Qt6 without mixing them is documented here: https://doc.qt.io/qt-6/cmake-qt5-and-qt6-compatibility.html
return true; | ||
} | ||
|
||
bool bWild = szFla.contains('w', Qt::CaseInsensitive); | ||
bool bContainsR = szFla.contains('r', Qt::CaseInsensitive); | ||
if(iMaxItems == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you move this condition down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IceN9ne's rewrote $str.split() in 2017 making use of QStringRef, that unfortunately doesn't exists anymore in Qt6.
I reverted a part of this commit: 9e8a9d9#diff-2c8a6d9d89531ab98f04a8dce7a8d6670d4661adac0b78edd4b5a38941890befR1717
else | ||
list = szStr.splitRef(szSep, splitBehavior, sensitivity); | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of changes in this function. I don't see in the PR description what this is for, so I don't know how to review this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed it in the PR description.
IceN9ne's rewrote $str.split() in 2017 making use of QStringRef / QString::splitRef(), but they unfortunately doesn't exists anymore in Qt6.
I reverted a part of this commit: 9e8a9d9#diff-2c8a6d9d89531ab98f04a8dce7a8d6670d4661adac0b78edd4b5a38941890befR1717
The previous version of $str.split() wasn't making use of those Qt features and could be ported without further changes
This PR contains all the needed bits to get KVIrc to compile with both Qt5 and Qt6.
Big changes:
Changes that will need some rework (last commit):
Other warnings that needs fixing:
The plain is to get this working on CI, collect any comment and maybe start getting the good commits one by one in master.