QWaylandWindow: adapt to QPlatformWindow::setBackingStore() addition

When qtbase/a4ca9e80658bca7dad1529f03c1b59173a6ecf62 added a virtual
QPlatformWindow::setBackingStore(), this was hidden by the existing
QWaylandWindow::setBackingStore(), causing a FTBFS on
-developer-builds.

Fix by using the newly-added detection macro to turn the existing
function into an overrider.

Pick-to: 6.6
Fixes: QTBUG-115691
Task-number: QTBUG-97482
Change-Id: If1d8c4443fe50030addb23331a50b7b9e1274626
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Marc Mutz 2023-08-02 08:28:52 +02:00
parent d8f0396961
commit 369a5296a9
2 changed files with 11 additions and 0 deletions

View File

@ -1500,6 +1500,13 @@ QVariant QWaylandWindow::property(const QString &name, const QVariant &defaultVa
return m_properties.value(name, defaultValue);
}
#ifdef QT_PLATFORM_WINDOW_HAS_VIRTUAL_SET_BACKING_STORE
void QWaylandWindow::setBackingStore(QPlatformBackingStore *store)
{
mBackingStore = dynamic_cast<QWaylandShmBackingStore *>(store);
}
#endif
void QWaylandWindow::timerEvent(QTimerEvent *event)
{
if (event->timerId() != mFrameCallbackCheckIntervalTimerId)

View File

@ -201,7 +201,11 @@ public:
QVariant property(const QString &name);
QVariant property(const QString &name, const QVariant &defaultValue);
#ifdef QT_PLATFORM_WINDOW_HAS_VIRTUAL_SET_BACKING_STORE
void setBackingStore(QPlatformBackingStore *store) override;
#else
void setBackingStore(QWaylandShmBackingStore *backingStore) { mBackingStore = backingStore; }
#endif
QWaylandShmBackingStore *backingStore() const { return mBackingStore; }
void setShellIntegration(QWaylandShellIntegration *shellIntegration);