widgets/designerplugins.cpp

Fri, 01 Jul 2022 16:46:43 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Fri, 01 Jul 2022 16:46:43 +0300
changeset 312
2637134bc37c
parent 281
afed72b544f0
child 347
5c655cc006de
permissions
-rw-r--r--

Fix right click to delete not really working properly
Instead of removing the point that had been added, it would remove
the point that is being drawn, which would cause it to overwrite the
previous point using the new point, causing a bit of a delay

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

PluginCollection::PluginCollection(QObject* parent) :
	QObject{parent}
{
	this->interfaces.append(new Vec3EditorPlugin{this});
	this->interfaces.append(new MatrixEditorPlugin{this});
	this->interfaces.append(new ColorButtonPlugin{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 ColorButtonPlugin::name() const
{
	return "ColorButton";
}

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

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

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

QString ColorButtonPlugin::includeFile() const
{
	return "widgets/colorbutton.h";
}

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

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

QWidget* ColorButtonPlugin::createWidget(QWidget* parent)
{
	return new ColorButton{parent};
}

mercurial