Preparation for port to Qt6
We can easily prepare a port to Qt6 with the following changes:
Mandatory:
-
Port source code to Qt 5.15 -
don't use deprecated Qt features (as of 5.15). -
Add add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050f00)
to CMakeLists.txt to make sure we don't fall back -
Replace all occurrences of QRegExp with QRegularExpression A bit of care might be necessary, as the syntax changes slightly between the two. Information about the difference can be found in the Qt documentation
all done (the remaining are inside comments) -
Replace all occurrences of QStringRef with QStringView Not sure if we use QStringRef at all
5 of 5 done -
Remove KWebView code, rely on QWebEngineView only (is this one still needed now that we use QTextBrowser?)
Note that QWebEngine won't be available in Qt6 until 6.2 release: https://wiki.qt.io/New_Features_in_Qt_6.2, which is to be released sometime in September 2021. EDIT: the same link shows that QtWebView is also getting ported to qt6.2, but ideally we'd want to rely on QWebEngine anyway: #37 (closed) -
Update the wiki, amend all the mentions of Qt and Qt5 and add special instructions for handling master (Qt6) -
Port QXmlSimpleReader to QXmlStreamReader -
Port QXmlSimpleWriter to QXmlStreamWriter -
Replace QFontMetrics::width() with QFontMetrics::horizontalAdvance() -
Eliminate usage of QString::sprintf() -
Use version-less Qt cmake targets -
Build with QT_NO_KEYWORDS -
Investigate usage of Gwenhywfar and potential other libs that depend on Qt -
More can be added here
Optional:
-
Port away from Q_FOREACH/foreach -
Replace all QHash with std::unordered_map -
Replace all QSet with std::unordered_set -
More can be added here