widgets/designerplugins.cpp

Thu, 15 Jun 2023 16:18:03 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Thu, 15 Jun 2023 16:18:03 +0300
changeset 383
530d23cd4e97
parent 349
673b8dffbe14
permissions
-rw-r--r--

Refactor, make selecting elements from the model select the corresponding line from the editor as well

#include "widgets/designerplugins.h"
#include "widgets/vec3editor.h"
#include "widgets/matrixeditor.h"
#include "widgets/coloredit.h"

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

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

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

QString Vec3EditorPlugin::group() const
{
	return CMAKE_PROJECT_NAME;
}

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

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

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

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

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

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

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

QString MatrixEditorPlugin::group() const
{
	return CMAKE_PROJECT_NAME;
}

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

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

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

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

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

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


QString ColorEditPlugin::name() const
{
	return "ColorEdit";
}

QString ColorEditPlugin::group() const
{
	return CMAKE_PROJECT_NAME;
}

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

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

QString ColorEditPlugin::includeFile() const
{
	return "widgets/coloredit.h";
}

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

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

QWidget* ColorEditPlugin::createWidget(QWidget* parent)
{
	return new ColorEdit{parent};
}

mercurial