aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-06-07 15:38:42 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-06-10 11:42:09 +0000
commitf07b73c5c5eb25c18fdfad2f83dea70bf02f82ee (patch)
tree1486eaa7a0c4e17f864c204f785496d1be088d03
parentf7f9aa00aac0f994fa54097c0674280f99a277b8 (diff)
MonthGrid: remove "pressed" context property
This isn't documented or tested, and it's possible to achieve using interactive controls like ItemDelegate or e.g. TapHandler. Fixes: QTBUG-114358 Change-Id: If9ac3d74f30439db774386eb5d598d8116997979 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 9831b38fc592bedd6fb9487a016846dbad246fb7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quicktemplates/qquickmonthgrid.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/quicktemplates/qquickmonthgrid.cpp b/src/quicktemplates/qquickmonthgrid.cpp
index a470017676..957c9b8f93 100644
--- a/src/quicktemplates/qquickmonthgrid.cpp
+++ b/src/quicktemplates/qquickmonthgrid.cpp
@@ -92,8 +92,6 @@ public:
bool handleRelease(const QPointF &point, ulong timestamp) override;
void handleUngrab() override;
- static void setContextProperty(QQuickItem *item, const QString &name, const QVariant &value);
-
QString title;
QVariant source;
QDate pressedDate;
@@ -141,7 +139,6 @@ void QQuickMonthGridPrivate::updatePress(const QPointF &pos)
Q_Q(QQuickMonthGrid);
clearPress(false);
pressedItem = cellAt(pos);
- setContextProperty(pressedItem, QStringLiteral("pressed"), true);
pressedDate = dateOf(pressedItem);
if (pressedDate.isValid())
emit q->pressed(pressedDate);
@@ -150,7 +147,6 @@ void QQuickMonthGridPrivate::updatePress(const QPointF &pos)
void QQuickMonthGridPrivate::clearPress(bool clicked)
{
Q_Q(QQuickMonthGrid);
- setContextProperty(pressedItem, QStringLiteral("pressed"), false);
if (pressedDate.isValid()) {
emit q->released(pressedDate);
if (clicked)
@@ -190,16 +186,6 @@ void QQuickMonthGridPrivate::handleUngrab()
clearPress(false);
}
-void QQuickMonthGridPrivate::setContextProperty(QQuickItem *item, const QString &name, const QVariant &value)
-{
- QQmlContext *context = qmlContext(item);
- if (context && context->isValid()) {
- context = context->parentContext();
- if (context && context->isValid())
- context->setContextProperty(name, value);
- }
-}
-
QQuickMonthGrid::QQuickMonthGrid(QQuickItem *parent) :
QQuickControl(*(new QQuickMonthGridPrivate), parent)
{
@@ -357,13 +343,6 @@ void QQuickMonthGrid::componentComplete()
{
Q_D(QQuickMonthGrid);
QQuickControl::componentComplete();
- if (d->contentItem) {
- const auto childItems = d->contentItem->childItems();
- for (QQuickItem *child : childItems) {
- if (!QQuickItemPrivate::get(child)->isTransparentForPositioner())
- d->setContextProperty(child, QStringLiteral("pressed"), false);
- }
- }
d->resizeItems();
}