chore: silence some deprecation warnings in Qt 6.8 #5529
Merged
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.
The underlying deprecations aren't new, but they haven't shown up as a warning in 6.7 and below.
Notably, the variant conversion/checking in
controllers/filters/lang/Types.hpp
was quite vocal (seems to be included in most files; transitively).QVariant::type
is deprecated (typeId
is preferred) in Qt 6, but there's no alternative in Qt 5. Furthermore,QMetaType::Type
contains predefined type-ids, while a type-id is of typeint
(in both Qt 5 and 6). This isn't really relevant for us, since we don't use user-types.Some other changes:
QVariant::canConvert<T>
is preferred overQVariant::canConvert(type-id)
QString::fromUcs4
prefers thechar32_t
overload (available in Qt 5)std::as_const
overqAsConst
(but we don't need either)QRegularExpression
got amatchView
in 6.5 which is preferred overmatch
for string views to avoid allocating a stringQDateTime::setTimeSpec
is deprecated (usesetTimeZone
- that's whatsetTimeSpec
does under the hood too)There are two other deprecations that are now reported which don't have a Qt 5 equivalent:
QMouseEvent::{screenPos, globalPos}
are deprecated, andglobalPosition
should be used (not in Qt 5)QWidget::addAction
: useaddAction(text, shortcut, object, slot)
instead (not in Qt 5 and these methods are onQMenu
in Qt 5)Otherwise, Qt 6.8 seems to work good enough on Windows. The only compilation error was that
QFile(path)
is now explicit (fixed in https://github.com/Chatterino/chatterino2/pull/5527/files#diff-07c979414bf7268bd34c32515e8500e25726e4ed1d43eb970f45bacff76b5bf3R111).