summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-20 13:42:08 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-20 13:53:57 (GMT)
commit200cc0ddbcb4cea11e79c0b53e2a43bb9f9e18f7 (patch)
tree733ade4de4c88ad085fb018a134886a3b54b2fe3
parentc520a4c75d16948417f6c1a3f42508510be0b5f4 (diff)
downloadQt-200cc0ddbcb4cea11e79c0b53e2a43bb9f9e18f7.zip
Qt-200cc0ddbcb4cea11e79c0b53e2a43bb9f9e18f7.tar.gz
Qt-200cc0ddbcb4cea11e79c0b53e2a43bb9f9e18f7.tar.bz2
Fix QGraphicsProxyWidget's window flag handling
This change fixes a few bugs and adds autotests for QGraphicsProxyWidget and QGraphicsWidget's window flag handling. The former behavior has been that you must set window flags on QGraphicsProxyWidget explicitly after calling proxy->setWidget(); otherwise both the flags from the embedded widget and the proxy would be partially ignored. Example: QLineEdit *edit = new QLineEdit(0, Qt::Window); // that's the default scene.addWidget(edit, Qt::Window); // proxy still has no window decos proxy->setWindowFlags(Qt::Window); // now it got decorations :-/ QGraphicsWidget's window flags are immune to reparenting, and are always polished with the necessary hints regardless of whether you set the flags during construction time or later. This is a feature QGraphicsWidget can provide because it allows toplevel widgets (without parents) to be normal widgets (i.e., non-windows). So the new behavior of QGraphicsProxyWidget is to respect its own window flags and ignore those of the embedded widget, regardless of what flags the embedded widget has when it's embedded. When QWidget auto-embeds child windows (file dialogs, popups, etc), it passes the correct window flags to the QGraphicsProxyWidget to ensure that the right flags are set. Task-number: 251407 Reviewed-by: Joao
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 9d82ffd..d856024 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -3187,7 +3187,7 @@ void tst_QGraphicsProxyWidget::windowFlags()
QVERIFY((widget->windowFlags() & widgetWFlags) == widgetWFlags);
proxy.setWidget(widget);
-
+
if (resultingProxyFlags == 0)
QVERIFY(!proxy.windowFlags());
else