diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-02-01 06:02:59 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-02-01 06:02:59 (GMT) |
commit | dc1cab966938edc5463f26189607ece134549a22 (patch) | |
tree | ecaab6c64758f41fa9cb5b376b395831a77e6c83 /tests/auto/qgraphicswidget | |
parent | 4915439de467d1119a46af66ea08dbe161d2f336 (diff) | |
parent | bde40a9fa852107c237ac408f93a33b5955b9290 (diff) | |
download | Qt-dc1cab966938edc5463f26189607ece134549a22.zip Qt-dc1cab966938edc5463f26189607ece134549a22.tar.gz Qt-dc1cab966938edc5463f26189607ece134549a22.tar.bz2 |
Merge commit 'oslo1/master' into oslo1-master
Conflicts:
doc/src/getting-started/installation.qdoc
src/gui/dialogs/qfiledialog_win.cpp
tools/assistant/tools/assistant/centralwidget.cpp
tools/assistant/tools/assistant/helpviewer.cpp
Diffstat (limited to 'tests/auto/qgraphicswidget')
-rw-r--r-- | tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index 909ea54..ac68224 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -163,6 +163,7 @@ private slots: void addChildInpolishEvent(); void polishEvent(); void polishEvent2(); + void autoFillBackground(); // Task fixes void task236127_bspTreeIndexFails(); @@ -2856,6 +2857,32 @@ void tst_QGraphicsWidget::polishEvent2() QVERIFY(widget->events.contains(QEvent::Polish)); } +void tst_QGraphicsWidget::autoFillBackground() +{ + QGraphicsWidget *widget = new QGraphicsWidget; + QCOMPARE(widget->autoFillBackground(), false); + widget->setAutoFillBackground(true); + QCOMPARE(widget->autoFillBackground(), true); + + const QColor color(Qt::red); + const QRect rect(0, 0, 1, 1); + + QGraphicsScene scene; + scene.addItem(widget); + widget->setGeometry(rect); + + QPalette palette = widget->palette(); + palette.setColor(QPalette::Window, color); + widget->setPalette(palette); + + QImage image(rect.size(), QImage::Format_RGB32); + QPainter painter; + painter.begin(&image); + scene.render(&painter, rect, rect); + painter.end(); + QCOMPARE(image.pixel(0, 0), color.rgb()); +} + void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems() { QGraphicsScene scene; |