widgets/designerplugins.h

Sun, 26 Jun 2022 21:32:51 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Sun, 26 Jun 2022 21:32:51 +0300
changeset 264
76a025db4948
parent 256
c6f5de03dc0f
child 269
593545977c5e
permissions
-rw-r--r--

Convert all includes to be relative to project root directory. Files that cannot be found in this manner use angle brackets.

253
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
1 #pragma once
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
2 #include <QObject>
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
3 #include <QDesignerCustomWidgetInterface>
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
4
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
5 class LDForgeWidgetCollection final : public QObject, public QDesignerCustomWidgetCollectionInterface
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
6 {
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
7 Q_OBJECT
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
8 Q_PLUGIN_METADATA(IID "org.qgis.customwidgets")
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
9 Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
10 // QDesignerCustomWidgetCollectionInterface interface
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
11 QList<QDesignerCustomWidgetInterface*> interfaces;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
12 public:
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
13 LDForgeWidgetCollection(QObject* parent = nullptr);
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
14 QList<QDesignerCustomWidgetInterface*> customWidgets() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
15 };
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
16
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
17 class Vec3EditorPlugin final : public QObject, public QDesignerCustomWidgetInterface
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
18 {
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
19 Q_OBJECT
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
20 Q_INTERFACES(QDesignerCustomWidgetInterface)
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
21 // QDesignerCustomWidgetInterface interface
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
22 public:
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
23 Vec3EditorPlugin(QObject* parent) : QObject{parent}{}
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
24 QString name() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
25 QString group() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
26 QString toolTip() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
27 QString whatsThis() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
28 QString includeFile() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
29 QIcon icon() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
30 bool isContainer() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
31 QWidget* createWidget(QWidget* parent) override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
32 };
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
33
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
34 class MatrixEditorPlugin final : public QObject, public QDesignerCustomWidgetInterface
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
35 {
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
36 Q_OBJECT
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
37 Q_INTERFACES(QDesignerCustomWidgetInterface)
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
38 // QDesignerCustomWidgetInterface interface
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
39 public:
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
40 MatrixEditorPlugin(QObject* parent) : QObject{parent}{}
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
41 QString name() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
42 QString group() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
43 QString toolTip() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
44 QString whatsThis() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
45 QString includeFile() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
46 QIcon icon() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
47 bool isContainer() const override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
48 QWidget* createWidget(QWidget* parent) override;
8b994c917f69 Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
49 };
256
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
50
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
51 class ColorButtonPlugin final : public QObject, public QDesignerCustomWidgetInterface
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
52 {
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
53 Q_OBJECT
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
54 Q_INTERFACES(QDesignerCustomWidgetInterface)
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
55 public:
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
56 ColorButtonPlugin(QObject* parent) : QObject{parent}{}
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
57 // QDesignerCustomWidgetInterface interface
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
58 QString name() const override;
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
59 QString group() const override;
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
60 QString toolTip() const override;
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
61 QString whatsThis() const override;
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
62 QString includeFile() const override;
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
63 QIcon icon() const override;
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
64 bool isContainer() const override;
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
65 QWidget* createWidget(QWidget* parent) override;
c6f5de03dc0f Move color button into widgets lib
Teemu Piippo <teemu.s.piippo@gmail.com>
parents: 253
diff changeset
66 };

mercurial