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
signalslotdialog_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 SIGNALSLOTDIALOG_H
17#define SIGNALSLOTDIALOG_H
18
20#include <QtCore/qstringlist.h>
21#include <QtWidgets/qdialog.h>
22#include <QtGui/qstandarditemmodel.h>
23
25
26class QDesignerFormEditorInterface;
27class QDesignerFormWindowInterface;
28class QDesignerDialogGuiInterface;
29class QDesignerMemberSheet;
30class QListView;
31class QToolButton;
32class QItemSelection;
33
34namespace Ui {
35 class SignalSlotDialogClass;
36}
37
38namespace qdesigner_internal {
39
40// Dialog data
46
47// Internal helper class: A model for signatures that allows for verifying duplicates
48// (checking signals versus slots and vice versa).
51
52public:
53 SignatureModel(QObject *parent = nullptr);
54 bool setData (const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
55
57 void checkSignature(const QString &signature, bool *ok);
58};
59
60// Internal helper class: Panel for editing method signatures. List view with validator,
61// add and remove button
62class SignaturePanel : public QObject {
64
65public:
67
69 void setData(const SignalSlotDialogData &d);
70 int count(const QString &signature) const;
71
73 void checkSignature(const QString &signature, bool *ok);
74
75private slots:
76 void slotAdd();
77 void slotRemove();
78 void slotSelectionChanged(const QItemSelection &, const QItemSelection &);
79
80private:
81 void closeEditor();
82
83 const QString m_newPrefix;
84 SignatureModel *m_model;
85 QListView *m_listView;
86 QToolButton *m_removeButton;
87};
88
89// Dialog for editing signals and slots.
90// Provides static convenience function
91// to modify fake signals and slots. They are
92// handled in 2 ways:
93// 1) For the MainContainer: Fake signals and slots are stored
94// in the meta database (per-instance)
95// 2) For promoted widgets: Fake signals and slots are stored
96// in the widget database (per-class)
97// Arguably, we could require the MainContainer to be promoted for that, too,
98// but that would require entering a header.
99
102
103public:
105
108
110
111 // Edit fake methods stored in MetaDataBase (per instance, used for main containers)
113
114 // Edit fake methods of a promoted class stored in WidgetDataBase (synthesizes a widget to obtain existing members).
116 // Edit fake methods of a promoted class stored in WidgetDataBase on a base class instance.
118
125
126
127private slots:
128 void slotCheckSignature(const QString &signature, bool *ok);
129
130private:
131 // Edit fake methods of a promoted class stored in WidgetDataBase using an instance of the base class.
133
139};
140}
141
142QT_END_NAMESPACE
143
144#endif
void setSignalSlot(const QString &signal, const QString &slot)
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
\reimp
void setData(const SignalSlotDialogData &d)
int count(const QString &signature) const
static QString widgetLabel(QDesignerFormEditorInterface *core, QWidget *widget)
static QString realClassName(QDesignerFormEditorInterface *core, QWidget *widget)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
bool signalMatchesSlot(QDesignerFormEditorInterface *core, const QString &signal, const QString &slot)
bool memberFunctionListContains(QDesignerFormEditorInterface *core, QObject *object, MemberType type, const QString &signature)
ClassesMemberFunctions reverseClassesMemberFunctions(const QString &obj_name, MemberType member_type, const QString &peer, QDesignerFormWindowInterface *form)
QMap< QString, QString > getMatchingSlots(QDesignerFormEditorInterface *core, QObject *object, const QString &signalSignature, bool showAll)
QString realObjectName(QDesignerFormEditorInterface *core, QObject *object)
QMap< QString, QString > getSignals(QDesignerFormEditorInterface *core, QObject *object, bool showAll)
#define QDESIGNER_SHARED_EXPORT
ClassMemberFunctions(const QString &_class_name)