diff options
Diffstat (limited to 'src/quicktemplates2/qquickcontrol.cpp')
-rw-r--r-- | src/quicktemplates2/qquickcontrol.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp index 26e28ebe..1fa70662 100644 --- a/src/quicktemplates2/qquickcontrol.cpp +++ b/src/quicktemplates2/qquickcontrol.cpp @@ -122,10 +122,20 @@ QT_BEGIN_NAMESPACE \section1 Event Handling All controls, except non-interactive indicators, do not let clicks and - touches through to items below them. For example, if \l Pane is used as the - \l {ApplicationWindow::}{header} or \l {ApplicationWindow::}{footer} of - \l ApplicationWindow, items underneath it will not get mouse or touch - events. + touches through to items below them. For example, the \c console.log() + call in the example below will never be executed when clicking on the + Pane, because the \l MouseArea is below it in the scene: + + \code + MouseArea { + anchors.fill: parent + onClicked: console.log("MouseArea was clicked") + + Pane { + anchors.fill: parent + } + } + \endcode \sa ApplicationWindow, Container */ @@ -413,7 +423,7 @@ void QQuickControlPrivate::setContentItem_helper(QQuickItem *item, bool notify) delete oldContentItem; if (item) { - connect(contentItem, &QQuickItem::baselineOffsetChanged, this, &QQuickControlPrivate::updateBaselineOffset); + connect(contentItem.data(), &QQuickItem::baselineOffsetChanged, this, &QQuickControlPrivate::updateBaselineOffset); if (!item->parentItem()) item->setParentItem(q); if (componentComplete) |