Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickaction_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQUICKACTION_P_P_H
6#define QQUICKACTION_P_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/private/qobject_p.h>
20#include <QtCore/qvariant.h>
21#include <QtCore/qstring.h>
22#if QT_CONFIG(shortcut)
23# include <QtGui/qkeysequence.h>
24#endif
25#include <QtQuick/private/qquickitemchangelistener_p.h>
26
28
29class QShortcutEvent;
30class QQuickActionGroup;
31
34{
35 Q_DECLARE_PUBLIC(QQuickAction)
36
37public:
39 {
40 return action->d_func();
41 }
42
43#if QT_CONFIG(shortcut)
44 QVariant shortcut() const;
45 void setShortcut(const QVariant &shortcut);
46#endif
47
48 void setEnabled(bool enable);
49
50 bool watchItem(QQuickItem *item);
51 bool unwatchItem(QQuickItem *item);
52
53 void registerItem(QQuickItem *item);
54 void unregisterItem(QQuickItem *item);
55
56 void itemVisibilityChanged(QQuickItem *item) override;
57 void itemDestroyed(QQuickItem *item) override;
58
59 bool handleShortcutEvent(QObject *object, QShortcutEvent *event);
60
61 void trigger(QObject*, bool doToggle);
62
63#if QT_CONFIG(shortcut)
64 class ShortcutEntry
65 {
66 public:
67 explicit ShortcutEntry(QObject *target);
69
70 QObject *target() const;
71 int shortcutId() const;
72
73 void grab(const QKeySequence &vshortcut, bool enabled);
74 void ungrab();
75
76 void setEnabled(bool enabled);
77
78 private:
79 int m_shortcutId = 0;
80 QObject *m_target = nullptr;
81 };
82
85#endif // QT_CONFIG(shortcut)
86
87 bool explicitEnabled = false;
88 bool enabled = true;
89 bool checked = false;
90 bool checkable = false;
92 QQuickIcon icon;
93#if QT_CONFIG(shortcut)
98#endif
99 QQuickActionGroup *group = nullptr;
100};
101
102QT_END_NAMESPACE
103
104#endif // QQUICKACTION_P_P_H
Groups actions together.
void trigger(QObject *, bool doToggle)
bool handleShortcutEvent(QObject *object, QShortcutEvent *event)
void itemDestroyed(QQuickItem *item) override
void registerItem(QQuickItem *item)
bool watchItem(QQuickItem *item)
QQuickActionGroup * group
void itemVisibilityChanged(QQuickItem *item) override
bool unwatchItem(QQuickItem *item)
void unregisterItem(QQuickItem *item)
Mutually-exclusive group of checkable buttons.