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
promotiontaskmenu_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
//
5
// W A R N I N G
6
// -------------
7
//
8
// This file is not part of the Qt API. It exists for the convenience
9
// of Qt Designer. This header
10
// file may change from version to version without notice, or even be removed.
11
//
12
// We mean it.
13
//
14
15
#
ifndef
PROMOTIONTASKMENU_H
16
#
define
PROMOTIONTASKMENU_H
17
18
#
include
"shared_global_p.h"
19
20
#
include
<
QtCore
/
qlist
.
h
>
21
#
include
<
QtCore
/
qobject
.
h
>
22
#
include
<
QtCore
/
qpointer
.
h
>
23
24
QT_BEGIN_NAMESPACE
25
26
class
QDesignerFormWindowInterface;
27
class
QDesignerFormEditorInterface;
28
29
class
QAction;
30
class
QMenu;
31
class
QWidget
;
32
33
namespace
qdesigner_internal
{
34
35
// A helper class for creating promotion context menus and handling promotion actions.
36
37
class
QDESIGNER_SHARED_EXPORT
PromotionTaskMenu
:
public
QObject
38
{
39
Q_OBJECT
40
public
:
41
enum
Mode
{
42
ModeSingleWidget
,
43
ModeManagedMultiSelection
,
44
ModeUnmanagedMultiSelection
45
};
46
47
explicit
PromotionTaskMenu
(
QWidget
*
widget
,
Mode
mode
=
ModeManagedMultiSelection
,
QObject
*
parent
=
nullptr
);
48
49
Mode
mode
()
const
;
50
void
setMode
(
Mode
m
);
51
52
void
setWidget
(
QWidget
*
widget
);
53
54
// Set menu labels
55
void
setPromoteLabel
(
const
QString
&
promoteLabel
);
56
void
setEditPromoteToLabel
(
const
QString
&
promoteEditLabel
);
57
// Defaults to "Demote to %1".arg(class).
58
void
setDemoteLabel
(
const
QString
&
demoteLabel
);
59
60
using
ActionList
=
QList
<
QAction
*>;
61
62
enum
AddFlags
{
LeadingSeparator
= 1,
TrailingSeparator
= 2,
SuppressGlobalEdit
= 4};
63
64
// Adds a list of promotion actions according to the current promotion state of the widget.
65
void
addActions
(
QDesignerFormWindowInterface
*
fw
,
unsigned
flags
,
ActionList
&
actionList
);
66
// Convenience that finds the form window.
67
void
addActions
(
unsigned
flags
,
ActionList
&
actionList
);
68
69
void
addActions
(
QDesignerFormWindowInterface
*
fw
,
unsigned
flags
,
QMenu
*
menu
);
70
void
addActions
(
unsigned
flags
,
QMenu
*
menu
);
71
72
// Pop up the editor in a global context.
73
static
void
editPromotedWidgets
(
QDesignerFormEditorInterface
*
core
,
QWidget
*
parent
);
74
75
private
slots
:
76
void
slotPromoteToCustomWidget
(
const
QString
&
customClassName
);
77
void
slotDemoteFromCustomWidget
();
78
void
slotEditPromotedWidgets
();
79
void
slotEditPromoteTo
();
80
void
slotEditSignalsSlots
();
81
82
private
:
83
void
promoteTo
(
QDesignerFormWindowInterface
*
fw
,
const
QString
&
customClassName
);
84
85
enum
PromotionState
{
NotApplicable
,
NoHomogenousSelection
,
CanPromote
,
CanDemote
};
86
PromotionState
createPromotionActions
(
QDesignerFormWindowInterface
*
formWindow
);
87
QDesignerFormWindowInterface
*
formWindow
()
const
;
88
89
using
PromotionSelectionList
=
QList
<
QPointer
<
QWidget
> >;
90
PromotionSelectionList
promotionSelectionList
(
QDesignerFormWindowInterface
*
formWindow
)
const
;
91
92
Mode
m_mode
;
93
94
QPointer
<
QWidget
>
m_widget
;
95
96
// Per-Widget actions
97
QList
<
QAction
*>
m_promotionActions
;
98
99
QAction
*
m_globalEditAction
;
100
QAction
*
m_EditPromoteToAction
;
101
QAction
*
m_EditSignalsSlotsAction
;
102
103
QString
m_promoteLabel
;
104
QString
m_demoteLabel
;
105
};
106
107
}
// namespace qdesigner_internal
108
109
QT_END_NAMESPACE
110
111
#
endif
// PROMOTIONTASKMENU_H
QDesignerContainerExtension
Definition
container.h:15
QPainter::QWidget
friend class QWidget
Definition
qpainter.h:421
qdesigner_internal::ContainerWidgetTaskMenuFactory
Definition
containerwidget_taskmenu.h:103
qdesigner_internal::ContainerWidgetTaskMenuFactory::createExtension
QObject * createExtension(QObject *object, const QString &iid, QObject *parent) const override
Creates an extension specified by iid for the given object.
Definition
containerwidget_taskmenu.cpp:270
qdesigner_internal::ContainerWidgetTaskMenu
Definition
containerwidget_taskmenu.h:31
qdesigner_internal::ContainerWidgetTaskMenu::preferredEditAction
QAction * preferredEditAction() const override
Definition
containerwidget_taskmenu.cpp:92
qdesigner_internal::ContainerWidgetTaskMenu::~ContainerWidgetTaskMenu
~ContainerWidgetTaskMenu() override
qdesigner_internal::ContainerWidgetTaskMenu::containerActions
QList< QAction * > & containerActions()
Definition
containerwidget_taskmenu.h:47
qdesigner_internal::ContainerWidgetTaskMenu::containerExtension
QDesignerContainerExtension * containerExtension() const
Definition
containerwidget_taskmenu.cpp:158
qdesigner_internal::ContainerWidgetTaskMenu::pageCount
int pageCount() const
Definition
containerwidget_taskmenu.cpp:110
qdesigner_internal::ContainerWidgetTaskMenu::taskActions
QList< QAction * > taskActions() const override
Definition
containerwidget_taskmenu.cpp:126
qdesigner_internal::MdiContainerWidgetTaskMenu
Definition
containerwidget_taskmenu.h:87
qdesigner_internal::MdiContainerWidgetTaskMenu::taskActions
QList< QAction * > taskActions() const override
Definition
containerwidget_taskmenu.cpp:250
qdesigner_internal::PromotionTaskMenu
Definition
promotiontaskmenu_p.h:38
qdesigner_internal::WizardContainerWidgetTaskMenu
Definition
containerwidget_taskmenu.h:72
qdesigner_internal::WizardContainerWidgetTaskMenu::taskActions
QList< QAction * > taskActions() const override
Definition
containerwidget_taskmenu.cpp:212
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:66
qdesigner_internal::ContainerType
ContainerType
Definition
shared_enums_p.h:43
qdesigner_internal::WizardContainer
@ WizardContainer
Definition
shared_enums_p.h:49
qdesigner_internal::PageContainer
@ PageContainer
Definition
shared_enums_p.h:45
qdesigner_internal::MdiContainer
@ MdiContainer
Definition
shared_enums_p.h:47
QDESIGNER_SHARED_EXPORT
#define QDESIGNER_SHARED_EXPORT
Definition
shared_global_p.h:32
qttools
src
designer
src
lib
shared
promotiontaskmenu_p.h
Generated on Sat Sep 21 2024 00:50:25 for Qt by
1.12.0