-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Porting Tiled to Qt 6 #2909
Merged
Porting Tiled to Qt 6 #2909
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bjorn
force-pushed
the
wip/qt6
branch
7 times, most recently
from
October 8, 2020 21:03
4dca7f1
to
f17df50
Compare
Still a large amount of work remaining to port the rest of the code.
Removed the JsonReader class, which is now no longer necessary and was using QTextCodec, which got removed in Qt 6.
Removed not very important "DontUseSheet" enum value that got stripped from Qt 6.
* QRegExp -> QRegularExpression * Use new version of qChecksum
Further removal of QStringRef would be possible if the minimum Qt version would be raised to Qt 5.10, though even with 5.15 QtringView does not entirely replace QStringRef unfortunately.
* QRegExp -> QRegularExpression * QLocale::decimalPoint now returns QString * QStyleOption::init -> initFrom * QLayout::setMargin -> setContentsMargins * QFont::resolve -> resolveMask (hidden API...)
Was apparently obsolete since at least Qt 5.6 already, but was never marked with a warning or exclusion macro...
Replaced with QRegularExpression, except for one case where wildcard matching is done, since QRegularExpression::wildcardToRegularExpression only exists since Qt 5.15.
* qHash changed signature * qrand() was removed (replaced with QRandomGenerator) * QDesktopWidget was removed (now using QWidget::screen) * QDataStream open mode enum changed location * Qt::AA_UseHighDpiPixmaps was removed * Adjustments due to flags deleting operator+ * QWheelEvent API changed * QWidget::enterEvent takes a custom QEnterEvent * Qt::MidButton was removed (replaced with Qt::MiddleButton) * QTextCodec was removed (replaced with encoding enum, but decided to remove TextFile.codec for now) * QLinkedList deprecated (replaced with std::list) * QMap::insertMulti removed (need to use QMultiMap) * Need to depend on openglwidgets module for QOpenGLWidget
Also adjusted another use of the removed QString::splitRef.
It appears types used in properties, signals, Q_INVOKABLE functions, etc. now need to be fully defined even when only referenced by pointer. This created many circular dependency issues, which is why I've opted to change many of such occurrences to QObject* and adding qobject_cast or static_cast where necessary.
* QSet::const_iterator no longer supports + operator * Further adjusting to removal of QString::midRef / QStringRef * QGuiApplication::setFallbackSessionManagementEnabled was removed * Qt::AA_DisableWindowContextHelpButton was removed * Shortcut modifiers no longer support + operator * Re-introduced TextFile.codec based on QStringConverter, but supporting less encodings * JSON binary data for tile stamps is no longer supported (but it appears Tiled never wrote these files in binary data, fortunately) * QShortcut parent is now QObject* instead of QWidget* Unfortunately, a linker issue remains when compiling with Qbs: /usr/bin/ld: cannot find -l-pthread
* Data modification when using QStringConverter::encodingForData (QTBUG-87466) * Crash when calling QStringDecoder::decode (not reported yet, unsure what causes it). For now we assume scripts are saved as UTF-8 when compiling against Qt 6.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the Qt 6.0 Alpha out it's time to start porting Tiled to Qt 6.
Of course, ideally while keeping it working against Qt 5.6, but more realistically we'll update the minimum required version of Qt to a more recent LTS version if that turns out to be too much effort.
(reopen of #2907, which was merged by accident, while still broken...)