Don't create QBackingStore for QDesktopWidget

QDesktopWidget doesn't need a backing store since it
cannot be painted on. Since the QDesktopWidget is
always created, this change avoids any resources
created in the QPlatformBackingStore contructor.

Change-Id: I33679c98363f9c0d7ea64d9c5e27327679ad92a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
bb10
Girish Ramakrishnan 2012-05-19 20:43:05 -07:00 committed by Qt by Nokia
parent 53a1e74009
commit ca86d1e8c3
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
QBackingStore *store = q->backingStore();
if (!store) {
if (win)
if (win && q->windowType() != Qt::Desktop)
q->setBackingStore(new QBackingStore(win));
else
q->setAttribute(Qt::WA_PaintOnScreen, true);