Port away from deprecated methods in Qt 5.14

Test Plan: Builds with -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 (as of today)

Reviewers: davidedmundson, broulik, apol

Reviewed By: apol

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23970
This commit is contained in:
David Faure 2019-09-16 05:40:25 +02:00
parent 1a8cfcd585
commit b466a2a211
4 changed files with 24 additions and 5 deletions

View File

@ -43,7 +43,7 @@ ColorScope::ColorScope(QQuickItem *parent, QObject *parentObject)
m_theme = s_theme.toStrongRef();
}
connect(s_theme.data(), &Plasma::Theme::themeChanged, this, &ColorScope::colorsChanged);
connect(m_theme.data(), &Plasma::Theme::themeChanged, this, &ColorScope::colorsChanged);
connect(this, &ColorScope::colorGroupChanged, this, &ColorScope::colorsChanged);

View File

@ -131,7 +131,13 @@ QString ContainmentActions::eventToString(QEvent *event)
int o = QObject::staticQtMetaObject.indexOfEnumerator("Orientations");
QMetaEnum orient = QObject::staticQtMetaObject.enumerator(o);
trigger = QStringLiteral("wheel:");
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
trigger += QString::fromLatin1(orient.valueToKey(e->orientation()));
#else
// ContainmentInterface::wheelEvent uses angleDelta.y()
// To support both, should we just remove this orientation string?
trigger += QStringLiteral("Vertical");
#endif
modifiers = e->modifiers();
break;
}

View File

@ -625,7 +625,7 @@ void FrameSvgPrivate::updateFrameData(UpdateType updateType)
if (newFd) {
//qCDebug(LOG_PLASMA) << "FOUND IT!" << newFd->refcount;
// we've found a match, use that one
Q_ASSERT(newKey == newFd.data()->cacheId);
Q_ASSERT(newKey == newFd.lock()->cacheId);
frame = newFd;
return;
}

View File

@ -1235,11 +1235,24 @@ bool Dialog::event(QEvent *event)
case QEvent::Wheel: {
QWheelEvent *we = static_cast<QWheelEvent *>(event);
if (!d->mainItemContainsPosition(we->pos())) {
QWheelEvent we2(d->positionAdjustedForMainItem(we->pos()),
d->positionAdjustedForMainItem(we->pos()) + position(),
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const QPoint pos = we->pos();
#else
const QPoint pos = we->position().toPoint();
#endif
if (!d->mainItemContainsPosition(pos)) {
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QWheelEvent we2(d->positionAdjustedForMainItem(pos),
d->positionAdjustedForMainItem(pos) + position(),
we->pixelDelta(), we->angleDelta(), we->angleDelta().y(),
we->orientation(), we->buttons(), we->modifiers(), we->phase());
#else
QWheelEvent we2(d->positionAdjustedForMainItem(pos),
d->positionAdjustedForMainItem(pos) + position(),
we->pixelDelta(), we->angleDelta(),
we->buttons(), we->modifiers(), we->phase(), false /*inverted*/);
#endif
if (isVisible()) {
QCoreApplication::sendEvent(this, &we2);