a40bfd5e20
Update to 5.4.2 OBS-URL: https://build.opensuse.org/request/show/310367 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtdeclarative?expand=0&rev=25
62 lines
2.6 KiB
Diff
62 lines
2.6 KiB
Diff
Parent: 9934c075 (QML: do not check stack size if stack grows up)
|
|
Author: David Edmundson <davidedmundson@kde.org>
|
|
AuthorDate: 2015-04-23 15:01:24 +0200
|
|
Commit: David Edmundson <davidedmundson@kde.org>
|
|
CommitDate: 2015-04-23 15:05:32 +0200
|
|
|
|
Avoid calling potentially pure virtual method
|
|
|
|
In Qt 5.4 screenChanged is called indirectly from the destructor of
|
|
QPlatformScreen. By comparing new values against the oldScreen we call
|
|
call virtual methods of QPlatformScreen from it's own destructor which
|
|
results in a crash.
|
|
|
|
This patch simply emits change signals whenever a screen change regardless
|
|
of whether the value differs from the previous screen. Arguably less
|
|
efficient, but better than crashing.
|
|
|
|
This fix is not needed in Qt 5.5 where the QPA architecture has changed.
|
|
|
|
Task-number: QTBUG-45753
|
|
Change-Id: Ic155906928855a377add9b21bff9e72b31f4667e
|
|
---
|
|
|
|
diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp
|
|
index 8ac5a1e..c19841f 100644
|
|
--- a/src/quick/items/qquickscreen.cpp
|
|
+++ b/src/quick/items/qquickscreen.cpp
|
|
@@ -347,24 +347,15 @@ void QQuickScreenAttached::screenChanged
|
|
emit orientationUpdateMaskChanged();
|
|
}
|
|
|
|
- if (!oldScreen || screen->size() != oldScreen->size()) {
|
|
- emit widthChanged();
|
|
- emit heightChanged();
|
|
- }
|
|
- if (!oldScreen || screen->name() != oldScreen->name())
|
|
- emit nameChanged();
|
|
- if (!oldScreen || screen->orientation() != oldScreen->orientation())
|
|
- emit orientationChanged();
|
|
- if (!oldScreen || screen->primaryOrientation() != oldScreen->primaryOrientation())
|
|
- emit primaryOrientationChanged();
|
|
- if (!oldScreen || screen->availableVirtualGeometry() != oldScreen->availableVirtualGeometry())
|
|
- emit desktopGeometryChanged();
|
|
- if (!oldScreen || screen->logicalDotsPerInch() != oldScreen->logicalDotsPerInch())
|
|
- emit logicalPixelDensityChanged();
|
|
- if (!oldScreen || screen->physicalDotsPerInch() != oldScreen->physicalDotsPerInch())
|
|
- emit pixelDensityChanged();
|
|
- if (!oldScreen || screen->devicePixelRatio() != oldScreen->devicePixelRatio())
|
|
- emit devicePixelRatioChanged();
|
|
+ emit widthChanged();
|
|
+ emit heightChanged();
|
|
+ emit nameChanged();
|
|
+ emit orientationChanged();
|
|
+ emit primaryOrientationChanged();
|
|
+ emit desktopGeometryChanged();
|
|
+ emit logicalPixelDensityChanged();
|
|
+ emit pixelDensityChanged();
|
|
+ emit devicePixelRatioChanged();
|
|
|
|
connect(screen, SIGNAL(geometryChanged(QRect)),
|
|
this, SIGNAL(widthChanged()));
|