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
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 _SIGNALSLOTDIALOG_H
16#define _SIGNALSLOTDIALOG_H
17
19#include <QtCore/qstringlist.h>
20#include <QtWidgets/qdialog.h>
21#include <QtGui/qstandarditemmodel.h>
22
24
25class QDesignerFormEditorInterface;
26class QDesignerFormWindowInterface;
27class QDesignerDialogGuiInterface;
28class QDesignerMemberSheet;
29class QListView;
30class QToolButton;
31class QItemSelection;
32
33namespace Ui {
34 class SignalSlotDialogClass;
35}
36
37namespace qdesigner_internal {
38
39// Dialog data
45
46// Internal helper class: A model for signatures that allows for verifying duplicates
47// (checking signals versus slots and vice versa).
50
51public:
52 SignatureModel(QObject *parent = nullptr);
53 bool setData (const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
54
56 void checkSignature(const QString &signature, bool *ok);
57};
58
59// Internal helper class: Panel for editing method signatures. List view with validator,
60// add and remove button
61class SignaturePanel : public QObject {
63
64public:
66
68 void setData(const SignalSlotDialogData &d);
69 int count(const QString &signature) const;
70
72 void checkSignature(const QString &signature, bool *ok);
73
74private slots:
75 void slotAdd();
76 void slotRemove();
77 void slotSelectionChanged(const QItemSelection &, const QItemSelection &);
78
79private:
80 void closeEditor();
81
82 const QString m_newPrefix;
83 SignatureModel *m_model;
84 QListView *m_listView;
85 QToolButton *m_removeButton;
86};
87
88// Dialog for editing signals and slots.
89// Provides static convenience function
90// to modify fake signals and slots. They are
91// handled in 2 ways:
92// 1) For the MainContainer: Fake signals and slots are stored
93// in the meta database (per-instance)
94// 2) For promoted widgets: Fake signals and slots are stored
95// in the widget database (per-class)
96// Arguably, we could require the MainContainer to be promoted for that, too,
97// but that would require entering a header.
98
101
102public:
104
107
109
110 // Edit fake methods stored in MetaDataBase (per instance, used for main containers)
112
113 // Edit fake methods of a promoted class stored in WidgetDataBase (synthesizes a widget to obtain existing members).
115 // Edit fake methods of a promoted class stored in WidgetDataBase on a base class instance.
117
124
125
126private slots:
127 void slotCheckSignature(const QString &signature, bool *ok);
128
129private:
130 // Edit fake methods of a promoted class stored in WidgetDataBase using an instance of the base class.
132
138};
139}
140
141QT_END_NAMESPACE
142
143#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)