1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the Qt Designer of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21 ** included in the packaging of this file. Please review the following
22 ** information to ensure the GNU General Public License requirements will
23 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24 **
25 ** $QT_END_LICENSE$
26 **
27 ****************************************************************************/
28 
29 #ifndef SIGNALSLOTEDITOR_H
30 #define SIGNALSLOTEDITOR_H
31 
32 #include "signalsloteditor_global.h"
33 
34 #include <QtDesigner/private/connectionedit_p.h>
35 
36 QT_BEGIN_NAMESPACE
37 
38 class DomConnections;
39 
40 namespace qdesigner_internal {
41 
42 class SignalSlotConnection;
43 
44 class QT_SIGNALSLOTEDITOR_EXPORT SignalSlotEditor : public ConnectionEdit
45 {
46     Q_OBJECT
47 
48 public:
49     SignalSlotEditor(QDesignerFormWindowInterface *form_window, QWidget *parent);
50 
51     virtual void setSignal(SignalSlotConnection *con, const QString &member);
52     virtual void setSlot(SignalSlotConnection *con, const QString &member);
53     void setSource(Connection *con, const QString &obj_name) override;
54     void setTarget(Connection *con, const QString &obj_name) override;
55 
56     DomConnections *toUi() const;
57     void fromUi(const DomConnections *connections, QWidget *parent);
58 
formWindow()59     QDesignerFormWindowInterface *formWindow() const { return m_form_window; }
60 
61     QObject *objectByName(QWidget *topLevel, const QString &name) const;
62 
63     void addEmptyConnection();
64 
65 protected:
66     QWidget *widgetAt(const QPoint &pos) const override;
67 
68 private:
69     Connection *createConnection(QWidget *source, QWidget *destination) override;
70     void modifyConnection(Connection *con) override;
71 
72     QDesignerFormWindowInterface *m_form_window;
73     bool m_showAllSignalsSlots;
74 
75     friend class SetMemberCommand;
76 };
77 
78 } // namespace qdesigner_internal
79 
80 QT_END_NAMESPACE
81 
82 #endif // SIGNALSLOTEDITOR_H
83