diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-11-19 11:16:45 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-11-24 13:42:13 (GMT) |
commit | f31d0e45952276f3de9c049c84a0ea52ce370e7f (patch) | |
tree | af80a3db435935018afa1bc8b7965d589fe7269d /tests/auto/qgraphicsproxywidget | |
parent | fc835ea41dffaa7ac6247c2d0d602aadf0e0f09b (diff) | |
download | Qt-f31d0e45952276f3de9c049c84a0ea52ce370e7f.zip Qt-f31d0e45952276f3de9c049c84a0ea52ce370e7f.tar.gz Qt-f31d0e45952276f3de9c049c84a0ea52ce370e7f.tar.bz2 |
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')
-rw-r--r-- | tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 36ee22c..42d5268 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" |