widgets/designerplugins.h

Mon, 27 Jun 2022 01:29:03 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Mon, 27 Jun 2022 01:29:03 +0300
changeset 267
9a482f506747
parent 256
c6f5de03dc0f
child 269
593545977c5e
permissions
-rw-r--r--

rename ldforge.qrc -> resources.qrc

#pragma once
#include <QObject>
#include <QDesignerCustomWidgetInterface>

class LDForgeWidgetCollection final : public QObject, public QDesignerCustomWidgetCollectionInterface
{
	Q_OBJECT
	Q_PLUGIN_METADATA(IID "org.qgis.customwidgets")
	Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
	// QDesignerCustomWidgetCollectionInterface interface
	QList<QDesignerCustomWidgetInterface*> interfaces;
public:
	LDForgeWidgetCollection(QObject* parent = nullptr);
	QList<QDesignerCustomWidgetInterface*> customWidgets() const override;
};

class Vec3EditorPlugin final : public QObject, public QDesignerCustomWidgetInterface
{
	Q_OBJECT
	Q_INTERFACES(QDesignerCustomWidgetInterface)
	// QDesignerCustomWidgetInterface interface
public:
	Vec3EditorPlugin(QObject* parent) : QObject{parent}{}
	QString name() const override;
	QString group() const override;
	QString toolTip() const override;
	QString whatsThis() const override;
	QString includeFile() const override;
	QIcon icon() const override;
	bool isContainer() const override;
	QWidget* createWidget(QWidget* parent) override;
};

class MatrixEditorPlugin final : public QObject, public QDesignerCustomWidgetInterface
{
	Q_OBJECT
	Q_INTERFACES(QDesignerCustomWidgetInterface)
	// QDesignerCustomWidgetInterface interface
public:
	MatrixEditorPlugin(QObject* parent) : QObject{parent}{}
	QString name() const override;
	QString group() const override;
	QString toolTip() const override;
	QString whatsThis() const override;
	QString includeFile() const override;
	QIcon icon() const override;
	bool isContainer() const override;
	QWidget* createWidget(QWidget* parent) override;
};

class ColorButtonPlugin final : public QObject, public QDesignerCustomWidgetInterface
{
	Q_OBJECT
	Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
	ColorButtonPlugin(QObject* parent) : QObject{parent}{}
	// QDesignerCustomWidgetInterface interface
	QString name() const override;
	QString group() const override;
	QString toolTip() const override;
	QString whatsThis() const override;
	QString includeFile() const override;
	QIcon icon() const override;
	bool isContainer() const override;
	QWidget* createWidget(QWidget* parent) override;
};

mercurial