Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qdesigner_promotiondialog_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
// Qt-Security score:significant reason:default
4
5
//
6
// W A R N I N G
7
// -------------
8
//
9
// This file is not part of the Qt API. It exists for the convenience
10
// of Qt Designer. This header
11
// file may change from version to version without notice, or even be removed.
12
//
13
// We mean it.
14
//
15
16
#
ifndef
PROMOTIONEDITORDIALOG_H
17
#
define
PROMOTIONEDITORDIALOG_H
18
19
#
include
<
QtWidgets
/
qdialog
.
h
>
20
#
include
<
QtWidgets
/
qgroupbox
.
h
>
21
22
QT_BEGIN_NAMESPACE
23
24
class
QDesignerFormEditorInterface;
25
class
QDesignerFormWindowInterface;
26
class
QDesignerPromotionInterface;
27
class
QDesignerWidgetDataBaseItemInterface
;
28
29
class
QTreeView;
30
class
QPushButton;
31
class
QItemSelection;
32
class
QDialogButtonBox;
33
class
QComboBox;
34
class
QLineEdit;
35
class
QCheckBox;
36
37
namespace
qdesigner_internal
{
38
struct
PromotionParameters
;
39
class
PromotionModel
;
40
41
42
// Panel for adding a new promoted class. Separate class for code cleanliness.
43
class
NewPromotedClassPanel
:
public
QGroupBox
{
44
Q_OBJECT
45
public
:
46
explicit
NewPromotedClassPanel
(
const
QStringList
&
baseClasses
,
47
int
selectedBaseClass
= -1,
48
QWidget
*
parent
=
nullptr
);
49
50
QString
promotedHeaderSuffix
()
const
{
return
m_promotedHeaderSuffix; }
51
void
setPromotedHeaderSuffix
(
const
QString &s) { m_promotedHeaderSuffix = s; }
52
53
bool
isPromotedHeaderLowerCase
()
const
{
return
m_promotedHeaderLowerCase; }
54
void
setPromotedHeaderLowerCase
(
bool
l) { m_promotedHeaderLowerCase = l; }
55
56
signals
:
57
void
newPromotedClass
(
const
PromotionParameters
&,
bool
*
ok
);
58
59
public
slots
:
60
void
grabFocus
();
61
void
chooseBaseClass
(
const
QString &);
62
private
slots
:
63
void
slotNameChanged
(
const
QString
&);
64
void
slotIncludeFileChanged(
const
QString &);
65
void
slotAdd();
66
void
slotReset();
67
68
private
:
69
PromotionParameters
promotionParameters()
const
;
70
void
enableButtons();
71
72
QString m_promotedHeaderSuffix;
73
bool
m_promotedHeaderLowerCase =
false
;
74
75
QComboBox *m_baseClassCombo;
76
QLineEdit *m_classNameEdit;
77
QLineEdit *m_includeFileEdit;
78
QCheckBox *m_globalIncludeCheckBox;
79
QPushButton *m_addButton;
80
};
81
82
// Dialog for editing promoted classes.
83
class
QDesignerPromotionDialog
:
public
QDialog
{
84
Q_OBJECT
85
86
public
:
87
enum
Mode
{
ModeEdit
,
ModeEditChooseClass
};
88
89
explicit
QDesignerPromotionDialog
(QDesignerFormEditorInterface *core,
90
QWidget
*parent =
nullptr
,
91
const
QString &promotableWidgetClassName = QString(),
92
QString *promoteTo =
nullptr
);
93
// Return an alphabetically ordered list of base class names for adding new classes.
94
static
const
QStringList
&
baseClassNames
(
const
QDesignerPromotionInterface *promotion);
95
96
signals
:
97
void
selectedBaseClassChanged
(
const
QString
&);
98
private
slots
:
99
void
slotRemove
();
100
void
slotAcceptPromoteTo();
101
void
slotSelectionChanged(
const
QItemSelection &,
const
QItemSelection &);
102
void
slotNewPromotedClass(
const
PromotionParameters
&,
bool
*ok);
103
104
void
slotIncludeFileChanged(
QDesignerWidgetDataBaseItemInterface
*,
const
QString &includeFile);
105
void
slotClassNameChanged(
QDesignerWidgetDataBaseItemInterface
*,
const
QString &newName);
106
void
slotUpdateFromWidgetDatabase();
107
void
slotTreeViewContextMenu(
const
QPoint &);
108
void
slotEditSignalsSlots();
109
110
private
:
111
QDialogButtonBox *createButtonBox();
112
void
delayedUpdateFromWidgetDatabase();
113
// Return item at model index and a combination of flags or 0.
114
enum
{ Referenced = 1, CanPromote = 2 };
115
QDesignerWidgetDataBaseItemInterface
*databaseItemAt(
const
QItemSelection &,
unsigned
&flags)
const
;
116
void
displayError(
const
QString &message);
117
118
const
Mode m_mode;
119
const
QString m_promotableWidgetClassName;
120
QDesignerFormEditorInterface *m_core;
121
QString *m_promoteTo;
122
QDesignerPromotionInterface *m_promotion;
123
PromotionModel
*m_model;
124
QTreeView *m_treeView;
125
QDialogButtonBox *m_buttonBox;
126
QPushButton *m_removeButton;
127
QString m_lastSelectedBaseClass;
128
};
129
}
// namespace qdesigner_internal
130
131
QT_END_NAMESPACE
132
133
#
endif
// PROMOTIONEDITORDIALOG_H
QDesignerWidgetDataBaseItemInterface
The QDesignerWidgetDataBaseItemInterface class provides an interface that is used to access individua...
Definition
abstractwidgetdatabase.h:21
QPainter::QWidget
friend class QWidget
Definition
qpainter.h:432
qdesigner_internal::NewPromotedClassPanel
Definition
qdesigner_promotiondialog_p.h:43
qdesigner_internal::NewPromotedClassPanel::promotedHeaderSuffix
QString promotedHeaderSuffix() const
Definition
qdesigner_promotiondialog_p.h:50
qdesigner_internal::NewPromotedClassPanel::isPromotedHeaderLowerCase
bool isPromotedHeaderLowerCase() const
Definition
qdesigner_promotiondialog_p.h:53
qdesigner_internal::NewPromotedClassPanel::setPromotedHeaderSuffix
void setPromotedHeaderSuffix(const QString &s)
Definition
qdesigner_promotiondialog_p.h:51
qdesigner_internal::NewPromotedClassPanel::setPromotedHeaderLowerCase
void setPromotedHeaderLowerCase(bool l)
Definition
qdesigner_promotiondialog_p.h:54
qdesigner_internal::NewPromotedClassPanel::chooseBaseClass
void chooseBaseClass(const QString &)
Definition
qdesigner_promotiondialog.cpp:168
qdesigner_internal::PromotionModel
Definition
promotionmodel_p.h:31
qdesigner_internal::QDesignerPromotionDialog
Definition
qdesigner_promotiondialog_p.h:83
qdesigner_internal::QDesignerPromotionDialog::baseClassNames
static const QStringList & baseClassNames(const QDesignerPromotionInterface *promotion)
Definition
qdesigner_promotiondialog.cpp:279
qdesigner_internal::QDesignerPromotionDialog::QDesignerPromotionDialog
QDesignerPromotionDialog(QDesignerFormEditorInterface *core, QWidget *parent=nullptr, const QString &promotableWidgetClassName=QString(), QString *promoteTo=nullptr)
Definition
qdesigner_promotiondialog.cpp:175
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:67
separatorAction
static QT_BEGIN_NAMESPACE QAction * separatorAction(QObject *parent)
Definition
promotiontaskmenu.cpp:30
languageExtension
static QDesignerLanguageExtension * languageExtension(QDesignerFormEditorInterface *core)
Definition
promotiontaskmenu.cpp:37
qdesigner_internal::PromotionParameters
Definition
qdesigner_promotiondialog.cpp:43
qttools
src
designer
src
lib
shared
qdesigner_promotiondialog_p.h
Generated on
for Qt by
1.18.0