aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickaccessibleattached_p.h
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2014-10-15 13:58:34 +0200
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2014-10-27 14:53:16 +0100
commit8f6436f125faae91eb472ddddbbae06dba5da671 (patch)
treecd99bd534e9e01ebddda584eb24a8bae3b195895 /src/quick/items/qquickaccessibleattached_p.h
parent32af8055985c1f978574eec62512638f472e8290 (diff)
Move action handlers to the Accessible attached object
With this change, instead of writing: function accessiblePressAction() { submit() } You should write: Accessible.onPressAction: { submit() } For the moment, only 4 actions are added: press, toggle, increase and decrease. The old style action handlers are deprecated, and removed from the documentation. New style action handlers will be preferred in case an item declares both styles. Change-Id: I11919e631d8476d55540f94252757b911c44ade4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickaccessibleattached_p.h')
-rw-r--r--src/quick/items/qquickaccessibleattached_p.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/quick/items/qquickaccessibleattached_p.h b/src/quick/items/qquickaccessibleattached_p.h
index 4875b2765a..53b1d2954d 100644
--- a/src/quick/items/qquickaccessibleattached_p.h
+++ b/src/quick/items/qquickaccessibleattached_p.h
@@ -188,6 +188,8 @@ public:
QAccessible::State state() { return m_state; }
bool ignored() const;
+ bool doAction(const QString &actionName);
+ void availableActions(QStringList *actions) const;
public Q_SLOTS:
void valueChanged() {
@@ -206,6 +208,10 @@ Q_SIGNALS:
void nameChanged();
void descriptionChanged();
void ignoredChanged();
+ void pressAction();
+ void toggleAction();
+ void increaseAction();
+ void decreaseAction();
private:
QQuickItem *item() const { return static_cast<QQuickItem*>(parent()); }
@@ -215,6 +221,11 @@ private:
QString m_name;
QString m_description;
+ static const QMetaMethod sigPress;
+ static const QMetaMethod sigToggle;
+ static const QMetaMethod sigIncrease;
+ static const QMetaMethod sigDecrease;
+
public:
using QObject::property;
};