path: root/src/plugins/platforms/openwfd/qopenwfdintegration.h
diff options
authorGiulio Camuffo <>2014-08-31 16:16:53 +0300
committerGiulio Camuffo <>2014-12-23 14:04:02 +0100
commit9b4fbe85d2e00c625c3d4abd975faf555000f685 (patch)
treec54ae3c4096b7a2c65bd66746ef64c4152b23dd1 /src/plugins/platforms/openwfd/qopenwfdintegration.h
parent3cda2ab03af655389a84b011d2eba8904b9658b6 (diff)
Add a function for QPA plugins to explicitly destroy QScreens
Previously QPlatformScreen was automatically deleting its QScreen in ~QPlatformScreen(). That means that we cannot use QScreen's methods when the screen is being removed, because doing so would call virtual methods of QPlatformScreen. By that point the QPlatformScreen subclass object does not exist anymore, and we call the default implementation instead of the subclassed one, or get a crash for the pure virtual methods. This happens for example when removing a screen which contains a QWindow with some QML item using QQuickScreenAttached. This patch adds a QPlatformIntegration::destroyScreen() function, which deletes the QScreen and later the QPlatformScreen. ~QPlatformScreen will still delete the QScreen if it was not deleted with destroyScreen(), so code not ported to the new approach will continue to work as before, with only a warning added. Task-number: QTBUG-41141 Change-Id: Ie4a03dee08ceb4c3e94a81875411f6f723273fe1 Reviewed-by: Jørgen Lind <> Reviewed-by: Shawn Rutledge <>
Diffstat (limited to 'src/plugins/platforms/openwfd/qopenwfdintegration.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/platforms/openwfd/qopenwfdintegration.h b/src/plugins/platforms/openwfd/qopenwfdintegration.h
index 6c086b73be..9243205caa 100644
--- a/src/plugins/platforms/openwfd/qopenwfdintegration.h
+++ b/src/plugins/platforms/openwfd/qopenwfdintegration.h
@@ -63,6 +63,7 @@ public:
QPlatformPrinterSupport *printerSupport() const;
void addScreen(QOpenWFDScreen *screen);
+ void destroyScreen(QOpenWFDScreen *screen);
QList<QPlatformScreen *> mScreens;
QList<QOpenWFDDevice *>mDevices;