Avoid calling potentially pure virtual method
authorDavid Edmundson <davidedmundson@kde.org>
Thu, 23 Apr 2015 13:01:24 +0000 (15:01 +0200)
committerDavid Edmundson <davidedmundson@kde.org>
Mon, 27 Apr 2015 17:41:43 +0000 (17:41 +0000)
commit0d31aa1617c96ed3e3624d77332ea6f13aba1492
tree34ac7a5fb6e93c2e791f174751836740364cb50a
parent7302bc550aa75600c7cdcf5c3d34404e0a09cf67
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
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
src/quick/items/qquickscreen.cpp