QWizard/Win: Fix incorrect cached state after all wizards destroyed
authorJonathan Liu <net147@gmail.com>
Sun, 2 Sep 2012 14:11:57 +0000 (00:11 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 3 Sep 2012 09:05:49 +0000 (11:05 +0200)
commit952ea029f40aaff9de0101fc165907ef8693e4aa
treeb1e853a2d8ec2ad14d2d42e66c7371f312d7dde8
parent6960fb2f6e7d338d16ad883a6feea0da448c76c1
QWizard/Win: Fix incorrect cached state after all wizards destroyed

If a QWizard is shown when Aero is enabled, the current visual style is
cached in a static member of QVistaHelper. The cached state is updated
by QVistaHelper when it receives WM_THEMECHANGED or
WM_DWMCOMPOSITIONCHANGED events from Windows.

If all QWizard instances are destroyed, there are no instances of
QVistaHelper to receive these notifications and update the cache. If
Aero is now disabled, the cached current visual style in QVistaHelper
isn't updated. If a wizard is now created and shown, a large black
rectangle is shown in the titlebar.

A static instance count is added so that when no wizards are running,
the cached state is not used.

Task-number: QTBUG-27004
Change-Id: Iefe4c8552388280219c9726418ed7476b8ebb15a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/widgets/dialogs/qwizard_win.cpp
src/widgets/dialogs/qwizard_win_p.h