diff options
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index dcd10d66240..36446c3e5c4 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -390,7 +390,9 @@ void QWidget::setAutoFillBackground(bool enabled) example, it is possible to display a button as a top-level window, but most people prefer to put their buttons inside other widgets, such as QDialog. - \image parent-child-widgets.png A parent widget containing various child widgets. + \image parent-child-widgets.png + {Appointment widget with labeled child widgets} + \caption A parent widget containing various child widgets. The diagram above shows a QGroupBox widget being used to hold various child widgets in a layout provided by QGridLayout. The QLabel child widgets have @@ -690,6 +692,8 @@ void QWidget::setAutoFillBackground(bool enabled) can be fine-tuned to achieve different effects. \image propagation-custom.png + {Three pixmaps of a house with different background properties: + transparent, filled with white, and uninitialized} In the above diagram, a semi-transparent rectangular child widget with an area removed is constructed and added to a parent widget (a QLabel showing @@ -733,6 +737,8 @@ void QWidget::setAutoFillBackground(bool enabled) in a non-standard way, as shown in the diagram below. \image propagation-standard.png + {One widget has a transparent background + and the other widget has a filled background} The scope for customizing the painting behavior of standard Qt widgets, without resorting to subclassing, is slightly less than that possible for @@ -11161,6 +11167,7 @@ void QWidget::scroll(int dx, int dy) for (const QRect &rect : d->dirty) proxy->update(rect.translated(dx, dy)); proxy->scroll(dx, dy, proxy->subWidgetRect(this)); + d->scrollChildren(dx, dy); // QTBUG-138381: scroll item view cell widgets return; } #endif @@ -13139,7 +13146,7 @@ void QWidget::initPainter(QPainter *painter) const const QPalette &pal = palette(); painter->d_func()->state->pen = QPen(pal.brush(foregroundRole()), 1); painter->d_func()->state->bgBrush = pal.brush(backgroundRole()); - QFont f(font(), const_cast<QWidget *>(this)); + QFont f(font(), this); painter->d_func()->state->deviceFont = f; painter->d_func()->state->font = f; } |