summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformwindow.cpp
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2023-07-13 16:50:03 +0200
committerAxel Spoerl <axel.spoerl@qt.io>2023-07-14 18:40:43 +0200
commita4ca9e80658bca7dad1529f03c1b59173a6ecf62 (patch)
treed78c94fccd4293e4f94f16c38597177b554a5c67 /src/plugins/platforms/android/qandroidplatformwindow.cpp
parentdbb072eb2838a04e89e34dad686394a496d5de87 (diff)
Implement virtual void QPlatformWindow::setBackingStore()
QWidget re-uses an existing backing store. Platform windows depend on being associated to a backing store, in case they become toplevel windows. If a platform window gets deleted and re-created each time it is shown or hidden, it has to be manually associated to the re-used backing store. This patch partly reverts fbf0aeea7d3b38ced7a16fcd5c3e2e9b45536292. It removes Android specific code from QWidgetPrivate::create(), which has been added to suppress re-using backing stores in the absence of the new API. Fixes: QTBUG-97482 Pick-to: 6.6 Change-Id: Iaa1b7652efa120ec1955914c0383e8ccd8a41429 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformwindow.cpp')
-rw-r--r--src/plugins/platforms/android/qandroidplatformwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformwindow.cpp b/src/plugins/platforms/android/qandroidplatformwindow.cpp
index b1eba17d04..1bc4a04b98 100644
--- a/src/plugins/platforms/android/qandroidplatformwindow.cpp
+++ b/src/plugins/platforms/android/qandroidplatformwindow.cpp
@@ -5,9 +5,9 @@
#include "qandroidplatformwindow.h"
#include "qandroidplatformopenglcontext.h"
#include "qandroidplatformscreen.h"
-
+#include "qandroidplatformbackingstore.h"
#include "androidjnimain.h"
-
+#include "qpa/qplatformbackingstore.h"
#include <qguiapplication.h>
#include <qpa/qwindowsysteminterface.h>
#include <private/qhighdpiscaling_p.h>
@@ -169,4 +169,12 @@ void QAndroidPlatformWindow::applicationStateChanged(Qt::ApplicationState)
QWindowSystemInterface::flushWindowSystemEvents();
}
+void QAndroidPlatformWindow::setBackingStore(QPlatformBackingStore *store)
+{
+ Q_ASSERT(store);
+ Q_ASSERT_X(dynamic_cast<QAndroidPlatformBackingStore *>(store), __FUNCTION__,
+ "Argument is not a QAndroidPlatformBackingStore.");
+ m_backingStore = static_cast<QAndroidPlatformBackingStore *>(store);
+}
+
QT_END_NAMESPACE