summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicswidget.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@gmail.com>2009-09-30 18:18:23 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-12-03 09:36:54 (GMT)
commit3f18623dd8f26857d9af032c41095818f5346910 (patch)
tree35efdb96b3b7794e949c2d7af7004e665238e29f /src/gui/graphicsview/qgraphicswidget.cpp
parentb93000823d11575b6c30490ea97a2649a0119f86 (diff)
downloadQt-3f18623dd8f26857d9af032c41095818f5346910.zip
Qt-3f18623dd8f26857d9af032c41095818f5346910.tar.gz
Qt-3f18623dd8f26857d9af032c41095818f5346910.tar.bz2
Added QGraphicsWidget::autoFillBackground property.
This add a property to QGraphicsWidget to fill its background. QWidget has the same. Merge-Request: 1656 Reviewed-by: Alexis Menard <alexis.menard@nokia.com>
Diffstat (limited to 'src/gui/graphicsview/qgraphicswidget.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index fe569f4..1bb6375 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -967,6 +967,36 @@ void QGraphicsWidget::setPalette(const QPalette &palette)
}
/*!
+ \property QGraphicsWidget::autoFillBackground
+ \brief whether the widget background is filled automatically
+ \since 4.7
+
+ If enabled, this property will cause Qt to fill the background of the
+ widget before invoking the paint() method. The color used is defined by the
+ QPalette::Window color role from the widget's \l{QPalette}{palette}.
+
+ In addition, Windows are always filled with QPalette::Window, unless the
+ WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set.
+
+ By default, this property is false.
+
+ \sa Qt::WA_OpaquePaintEvent, Qt::WA_NoSystemBackground,
+*/
+bool QGraphicsWidget::autoFillBackground() const
+{
+ Q_D(const QGraphicsWidget);
+ return d->autoFillBackground;
+}
+void QGraphicsWidget::setAutoFillBackground(bool enabled)
+{
+ Q_D(QGraphicsWidget);
+ if (d->autoFillBackground != enabled) {
+ d->autoFillBackground = enabled;
+ update();
+ }
+}
+
+/*!
If this widget is currently managed by a layout, this function notifies
the layout that the widget's size hints have changed and the layout
may need to resize and reposition the widget accordingly.