summaryrefslogtreecommitdiff
path: root/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-11-19 12:16:45 +0100
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-11-24 14:42:13 +0100
commitf31d0e45952276f3de9c049c84a0ea52ce370e7f (patch)
treeaf80a3db435935018afa1bc8b7965d589fe7269d /tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
parentfc835ea41dffaa7ac6247c2d0d602aadf0e0f09b (diff)
downloadqt4-tools-f31d0e45952276f3de9c049c84a0ea52ce370e7f.tar.gz
Mac: Fixes broken window decorations for QGraphicsProxyWidget.
The problem was the QMacStyle didn't handle the pixel metric for PM_TitleBarHeight correctly when passing a style option containing an unitialized rect (empty rect). It already had special logic for invalid rects, so the fix is simply to extend the check to also handle empty rects. Auto-test included. Task-number: QTBUG-4160 Reviewed-by: msorvig
Diffstat (limited to 'tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp')
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 36ee22c96a..42d52686c4 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -181,6 +181,7 @@ private slots:
void updateAndDelete();
void inputMethod();
void clickFocus();
+ void windowFrameMargins();
};
// Subclass that exposes the protected functions.
@@ -3506,6 +3507,29 @@ void tst_QGraphicsProxyWidget::clickFocus()
QVERIFY(!proxy->widget()->hasFocus());
}
+void tst_QGraphicsProxyWidget::windowFrameMargins()
+{
+ // Make sure the top margin is non-zero when passing Qt::Window.
+ QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(0, Qt::Window);
+
+ qreal left, top, right, bottom;
+ proxy->getWindowFrameMargins(&left, &top, &right, &bottom);
+ QVERIFY(top > 0);
+
+ proxy->setWidget(new QPushButton("testtest"));
+ proxy->getWindowFrameMargins(&left, &top, &right, &bottom);
+ QVERIFY(top > 0);
+
+ QGraphicsScene scene;
+ scene.addItem(proxy);
+ proxy->getWindowFrameMargins(&left, &top, &right, &bottom);
+ QVERIFY(top > 0);
+
+ proxy->unsetWindowFrameMargins();
+ proxy->getWindowFrameMargins(&left, &top, &right, &bottom);
+ QVERIFY(top > 0);
+}
+
QTEST_MAIN(tst_QGraphicsProxyWidget)
#include "tst_qgraphicsproxywidget.moc"