widgets/designerplugins.h

Wed, 22 Jun 2022 22:50:37 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Wed, 22 Jun 2022 22:50:37 +0300
changeset 255
5188f8a74a5c
parent 253
8b994c917f69
child 256
c6f5de03dc0f
permissions
-rw-r--r--

Add x, y, z properties to VectorInput

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 };

mercurial