diff options
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 8 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qboxlayout.cpp | 10 | ||||
-rw-r--r-- | src/widgets/kernel/qformlayout.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qgesture.cpp | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qrhiwidget.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwhatsthis.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 11 |
8 files changed, 28 insertions, 17 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index bcf10ad8ed2..6fcfcf1b1ef 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2733,7 +2733,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) QPointer<QWidget> pw = w; while (w) { - QMouseEvent me(mouse->type(), relpos, mouse->scenePosition(), mouse->globalPosition().toPoint(), + QMouseEvent me(mouse->type(), relpos, mouse->scenePosition(), mouse->globalPosition(), mouse->button(), mouse->buttons(), mouse->modifiers(), mouse->source(), mouse->pointingDevice()); me.m_spont = mouse->spontaneous(); @@ -2767,7 +2767,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) w = static_cast<QWidget *>(receiver); relpos = mouse->position().toPoint(); - QPoint diff = relpos - w->mapFromGlobal(mouse->globalPosition().toPoint()); + QPoint diff = relpos - w->mapFromGlobal(mouse->globalPosition()).toPoint(); while (w) { if (w->testAttribute(Qt::WA_Hover) && (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { @@ -2781,8 +2781,6 @@ bool QApplication::notify(QObject *receiver, QEvent *e) w = w->parentWidget(); } } - - d->hoverGlobalPos = mouse->globalPosition().toPoint(); break; } #if QT_CONFIG(wheelevent) @@ -3803,7 +3801,7 @@ bool QApplicationPrivate::translateRawTouchEvent(QWidget *window, const QTouchEv window = QApplication::topLevelAt(touchPoint.globalPosition().toPoint()); if (!window) continue; - target = window->childAt(window->mapFromGlobal(touchPoint.globalPosition().toPoint())); + target = window->childAt(window->mapFromGlobal(touchPoint.globalPosition())); if (!target) target = window; } diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 2b33e33a2a4..25b887aa4be 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -124,7 +124,7 @@ public: #endif QBasicTimer toolTipWakeUp, toolTipFallAsleep; - QPoint toolTipPos, toolTipGlobalPos, hoverGlobalPos; + QPoint toolTipPos, toolTipGlobalPos; QPointer<QWidget> toolTipWidget; static QSize app_strut; diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp index ad3744986d7..312297fd603 100644 --- a/src/widgets/kernel/qboxlayout.cpp +++ b/src/widgets/kernel/qboxlayout.cpp @@ -432,7 +432,7 @@ int QBoxLayoutPrivate::validateIndex(int index) const the parentWidget()), divides it up into a row of boxes, and makes each managed widget fill one box. - \image qhboxlayout-with-5-children.png Horizontal box layout with five child widgets + \image qhboxlayout-with-5-children.png {Five buttons in horizontal layout} If the QBoxLayout's orientation is Qt::Horizontal the boxes are placed in a row, with suitable sizes. Each widget (or other box) @@ -440,7 +440,7 @@ int QBoxLayoutPrivate::validateIndex(int index) const Any excess space is shared according to the stretch factors (more about that below). - \image qvboxlayout-with-5-children.png Vertical box layout with five child widgets + \image qvboxlayout-with-5-children.png {Five buttons in vertical layout} If the QBoxLayout's orientation is Qt::Vertical, the boxes are placed in a column, again with suitable sizes. @@ -1225,7 +1225,8 @@ QBoxLayout::Direction QBoxLayout::direction() const object onto \c window. At that point, the widgets in the layout are reparented to have \c window as their parent. - \image qhboxlayout-with-5-children.png Horizontal box layout with five child widgets + \image qhboxlayout-with-5-children.png + {Five buttons in horizontal layout} \sa QVBoxLayout, QGridLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example} */ @@ -1298,7 +1299,8 @@ QHBoxLayout::~QHBoxLayout() object onto \c window. At that point, the widgets in the layout are reparented to have \c window as their parent. - \image qvboxlayout-with-5-children.png Horizontal box layout with five child widgets + \image qvboxlayout-with-5-children.png + {Horizontal box layout with five child widgets} \sa QHBoxLayout, QGridLayout, QStackedLayout, {Layout Management}, {Basic Layouts Example} */ diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp index 3cc7256d957..e94ca478ef7 100644 --- a/src/widgets/kernel/qformlayout.cpp +++ b/src/widgets/kernel/qformlayout.cpp @@ -1074,9 +1074,13 @@ QLayoutItem* QFormLayoutPrivate::replaceAt(int index, QLayoutItem *newitem) \li Qt Extended styles \row \li \inlineimage qformlayout-win.png + {Form layout in traditional desktop style} \li \inlineimage qformlayout-mac.png + {Form layout in macOS Aqua style} \li \inlineimage qformlayout-kde.png + {Form layout in KDE Plastique style} \li \inlineimage qformlayout-qpe.png + {Form layout in Qt Extended style} \row \li Traditional style used for Windows, GNOME, and earlier versions of KDE. Labels are left aligned, and expanding diff --git a/src/widgets/kernel/qgesture.cpp b/src/widgets/kernel/qgesture.cpp index 736c95ac296..14e4a345fa3 100644 --- a/src/widgets/kernel/qgesture.cpp +++ b/src/widgets/kernel/qgesture.cpp @@ -196,7 +196,7 @@ QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const \ingroup gestures \inmodule QtWidgets - \image pangesture.png + \image pangesture.png {Demonstration of moving an image with pan gesture} For an overview of gesture handling in Qt and information on using gestures in your applications, see the \l{Gestures in Widgets and Graphics View} document. @@ -327,7 +327,7 @@ void QPanGesture::setAcceleration(qreal value) For an overview of gesture handling in Qt and information on using gestures in your applications, see the \l{Gestures in Widgets and Graphics View} document. - \image pinchgesture.png + \image pinchgesture.png {Demonstration of pinch gesture with two fingers} Instead of repeatedly applying the same pinching gesture, the user may continue to touch the input device in one place, and apply a second touch @@ -591,7 +591,7 @@ void QPinchGesture::setRotationAngle(qreal value) \ingroup gestures \inmodule QtWidgets - \image swipegesture.png + \image swipegesture.png {Demonstration of swipe gesture} For an overview of gesture handling in Qt and information on using gestures in your applications, see the \l{Gestures in Widgets and Graphics View} document. diff --git a/src/widgets/kernel/qrhiwidget.cpp b/src/widgets/kernel/qrhiwidget.cpp index dbea5f16240..e7c23572ce4 100644 --- a/src/widgets/kernel/qrhiwidget.cpp +++ b/src/widgets/kernel/qrhiwidget.cpp @@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE The result is a widget that shows the following: - \image qrhiwidget-intro.jpg + \image qrhiwidget-intro.jpg {Multicolored triangle on a green background} For a complete, minimal, introductory example check out the \l{Simple RHI Widget Example}. diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index 75e916fa511..bc91c76494e 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE the appropriate help text is shown. The mode is left when help is given or when the user presses Esc. - \image whatsthis.png + \image whatsthis.png {"What's This?" mode for New File button} You can enter "What's This?" mode programmatically with enterWhatsThisMode(), check the mode with inWhatsThisMode(), and 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; } |