Fix for excess creation of QWindow instances.

topData() is called from various functions for any kind of widgets,
not just for top-levels. Therefore createTLSysExtra cannot assume
that the widget is top-level. Previously QWindows were created
for desktop widget, toolbars, mdi subwindows, etc. which is
wrong. The patch will avoid this, and will also fix drawing
isses when dragging mdi windows.

Reviewed-by: Samuel Rødal
This commit is contained in:
Laszlo Agocs 2011-05-31 13:38:42 +02:00
parent 7db1f8fc04
commit bc75a8963e

View File

@ -760,7 +760,9 @@ void QWidgetPrivate::createTLSysExtra()
{
Q_Q(QWidget);
extra->topextra->screenIndex = 0;
extra->topextra->window = new QWidgetWindow(q);
extra->topextra->window = 0;
if ((q->testAttribute(Qt::WA_NativeWindow) || q->isWindow()) && q->windowType() != Qt::Desktop)
extra->topextra->window = new QWidgetWindow(q);
}
void QWidgetPrivate::deleteTLSysExtra()