Coverage Report

Created: 2026-05-16 06:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/qt/qtbase/src/gui/kernel/qaction_p.h
Line
Count
Source
1
// Copyright (C) 2019 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 QACTION_P_H
6
#define QACTION_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 for the convenience
13
// of other Qt classes.  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 <QtGui/private/qtguiglobal_p.h>
20
#include <QtGui/qaction.h>
21
#include <QtGui/qfont.h>
22
#if QT_CONFIG(shortcut)
23
#  include <QtGui/private/qshortcutmap_p.h>
24
#endif
25
26
#include <QtCore/qpointer.h>
27
#include "private/qobject_p.h"
28
29
QT_REQUIRE_CONFIG(action);
30
31
QT_BEGIN_NAMESPACE
32
33
class QShortcutMap;
34
35
class Q_GUI_EXPORT QActionPrivate : public QObjectPrivate
36
{
37
0
    Q_DECLARE_PUBLIC(QAction)
Unexecuted instantiation: QActionPrivate::q_func() const
Unexecuted instantiation: QActionPrivate::q_func()
38
0
public:
39
0
    QActionPrivate();
40
0
    ~QActionPrivate();
41
0
42
0
    virtual void destroy();
43
0
44
0
#if QT_CONFIG(shortcut)
45
0
    virtual QShortcutMap::ContextMatcher contextMatcher() const;
46
0
#endif
47
0
48
0
    static QActionPrivate *get(QAction *q)
49
0
    {
50
0
        return q->d_func();
51
0
    }
52
53
    bool setEnabled(bool enable, bool byGroup);
54
    void setVisible(bool b);
55
56
    QPointer<QActionGroup> group;
57
    QString text;
58
    QString iconText;
59
    QIcon icon;
60
    QString tooltip;
61
    QString statustip;
62
    QString whatsthis;
63
#if QT_CONFIG(shortcut)
64
    QList<QKeySequence> shortcuts;
65
#endif
66
    QVariant userData;
67
68
    QObjectList associatedObjects;
69
    virtual QObject *menu() const;
70
    virtual void setMenu(QObject *menu);
71
72
#if QT_CONFIG(shortcut)
73
    QList<int> shortcutIds;
74
    Qt::ShortcutContext shortcutContext = Qt::WindowShortcut;
75
    uint autorepeat : 1;
76
#endif
77
    QFont font;
78
    uint enabled : 1, explicitEnabled : 1, explicitEnabledValue : 1;
79
    uint visible : 1, forceInvisible : 1;
80
    uint checkable : 1;
81
    uint checked : 1;
82
    uint separator : 1;
83
    uint fontSet : 1;
84
85
    int iconVisibleInMenu : 2;  // Only has values -1, 0, and 1
86
    int shortcutVisibleInContextMenu : 2; // Only has values -1, 0, and 1
87
88
    QAction::MenuRole menuRole = QAction::TextHeuristicRole;
89
    QAction::Priority priority = QAction::NormalPriority;
90
91
#if QT_CONFIG(shortcut)
92
    void redoGrab(QShortcutMap &map);
93
    void redoGrabAlternate(QShortcutMap &map);
94
    void setShortcutEnabled(bool enable, QShortcutMap &map);
95
#endif // QT_NO_SHORTCUT
96
97
    bool showStatusText(QObject *widget, const QString &str);
98
    void sendDataChanged();
99
};
100
101
QT_END_NAMESPACE
102
103
#endif // QACTION_P_H