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
newactiondialog_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef NEWACTIONDIALOG_P_H
5#define NEWACTIONDIALOG_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qdesigner_utils_p.h" // PropertySheetIconValue
19
20#include <QtWidgets/qdialog.h>
21#include <QtGui/qkeysequence.h>
22#include <QtCore/qcompare.h>
23
25
26namespace qdesigner_internal {
27
28namespace Ui {
29 class NewActionDialog;
30}
31
32class ActionEditor;
33
34struct ActionData {
35
41
42 // Returns a combination of ChangeMask flags
43 unsigned compare(const ActionData &rhs) const;
44
45 QString text;
46 QString name;
47 QString toolTip;
49 bool checkable{false};
50 PropertySheetKeySequenceValue keysequence;
52
53 friend bool comparesEqual(const ActionData &lhs, const ActionData &rhs) noexcept
54 {
55 return lhs.compare(rhs) == 0;
56 }
58};
59
61{
63public:
66
67 ActionData actionData() const;
68 void setActionData(const ActionData &d);
69
70 QString actionText() const;
71 QString actionName() const;
72
73public slots:
74 void focusName();
75 void focusText();
76 void focusTooltip();
77 void focusShortcut();
78 void focusCheckable();
79 void focusMenuRole();
80
81private slots:
83 void onEditObjectNameTextEdited(const QString &text);
84
85 void slotEditToolTip();
86 void slotResetKeySequence();
87
88private:
89 Ui::NewActionDialog *m_ui;
90 ActionEditor *m_actionEditor;
91 bool m_autoUpdateObjectName;
92
93 void updateButtons();
94};
95
96} // namespace qdesigner_internal
97
98QT_END_NAMESPACE
99
100#endif // NEWACTIONDIALOG_P_H
static constexpr auto toolTipPropertyC
static constexpr auto iconPropertyC
static constexpr auto textPropertyC
static constexpr auto shortcutPropertyC
static constexpr auto menuRolePropertyC
static constexpr auto actionEditorViewModeKey
static constexpr auto objectNamePropertyC
static constexpr auto checkablePropertyC
friend class QPainter
void drawFocus(QPainter *, const QStyleOptionViewItem &, const QRect &) const override
Renders the region within the rectangle specified by rect, indicating that it has the focus,...
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
This pure abstract function must be reimplemented if you want to provide custom rendering.
void dragEnterEvent(QDragEnterEvent *event) override
void dropEvent(QDropEvent *event) override
void focusInEvent(QFocusEvent *event) override
void contextMenuEvent(QContextMenuEvent *event) override
void startDrag(Qt::DropActions supportedActions) override
void currentActionChanged(QAction *action)
void dragMoveEvent(QDragMoveEvent *event) override
void actionActivated(QAction *action)
void dropEvent(QDropEvent *event) override
void dragMoveEvent(QDragMoveEvent *event) override
void actionActivated(QAction *action, int column)
void focusInEvent(QFocusEvent *event) override
void startDrag(Qt::DropActions supportedActions) override
void contextMenuEvent(QContextMenuEvent *event) override
void currentActionChanged(QAction *action)
void dragEnterEvent(QDragEnterEvent *event) override
void setSelectionMode(QAbstractItemView::SelectionMode sm)
QAbstractItemView::SelectionMode selectionMode() const
void currentChanged(QAction *action)
void resourceImageDropped(const QString &data, QAction *action)
void setCurrentIndex(const QModelIndex &index)
void initialize(QDesignerFormEditorInterface *core)
void activated(QAction *action, int column)
void setActionData(const ActionData &d)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static QDesignerFormWindowCommand * setKeySequencePropertyCommand(const PropertySheetKeySequenceValue &ks, QAction *action, QDesignerFormWindowInterface *fw)
static CharacterCategory category(QChar c)
static QDesignerFormWindowCommand * setIconPropertyCommand(const PropertySheetIconValue &newIcon, QAction *action, QDesignerFormWindowInterface *fw)
static void setInitialProperty(QDesignerPropertySheetExtension *sheet, const QString &name, const QVariant &value)
static void refreshIconPropertyChanged(const QAction *action, QDesignerPropertySheetExtension *sheet)
static QString underscore(QString text)
static QString textPropertyValue(const QDesignerPropertySheetExtension *sheet, const QString &name)
static QString camelCase(const QString &text)
QDesignerFormWindowCommand * setPropertyCommand(const QString &name, T value, T defaultValue, QObject *o, QDesignerFormWindowInterface *fw)
#define QDESIGNER_SHARED_EXPORT
unsigned compare(const ActionData &rhs) const
PropertySheetKeySequenceValue keysequence
PropertySheetFlagValue menuRole
friend bool comparesEqual(const ActionData &lhs, const ActionData &rhs) noexcept