widgets/designerplugins.cpp

Wed, 22 Jun 2022 21:42:10 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Wed, 22 Jun 2022 21:42:10 +0300
changeset 253
8b994c917f69
child 254
b7b29cb82360
permissions
-rw-r--r--

Make LDForge widgets visible in Qt Designer

#include "designerplugins.h"
#include "vec3editor.h"
#include "matrixeditor.h"

LDForgeWidgetCollection::LDForgeWidgetCollection(QObject* parent) :
	QObject{parent}
{
	this->interfaces.append(new Vec3EditorPlugin{this});
	this->interfaces.append(new MatrixEditorPlugin{this});
}

QList<QDesignerCustomWidgetInterface*> LDForgeWidgetCollection::customWidgets() const
{
	return this->interfaces;
}

QString Vec3EditorPlugin::name() const
{
	return "Vec3Editor";
}

QString Vec3EditorPlugin::group() const
{
	return "LDForge";
}

QString Vec3EditorPlugin::toolTip() const
{
	return "";
}

QString Vec3EditorPlugin::whatsThis() const
{
	return "";
}

QString Vec3EditorPlugin::includeFile() const
{
	return "vec3editor.h";
}

QIcon Vec3EditorPlugin::icon() const
{
	return {};
}

bool Vec3EditorPlugin::isContainer() const
{
	return false;
}

QWidget* Vec3EditorPlugin::createWidget(QWidget* parent)
{
	return new Vec3Editor{{0, 0, 0}, parent};
}

QString MatrixEditorPlugin::name() const
{
	return "MatrixEditor";
}

QString MatrixEditorPlugin::group() const
{
	return "LDForge";
}

QString MatrixEditorPlugin::toolTip() const
{
	return "";
}

QString MatrixEditorPlugin::whatsThis() const
{
	return "";
}

QString MatrixEditorPlugin::includeFile() const
{
	return "matrixeditor.h";
}

QIcon MatrixEditorPlugin::icon() const
{
	return {};
}

bool MatrixEditorPlugin::isContainer() const
{
	return false;
}

QWidget* MatrixEditorPlugin::createWidget(QWidget* parent)
{
	return new MatrixEditor{parent};
}

mercurial