src/ui/objecteditor.h

Mon, 16 May 2022 01:40:49 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Mon, 16 May 2022 01:40:49 +0300
changeset 187
30204975694a
parent 183
97b591813c8b
child 200
ca23936b455b
permissions
-rw-r--r--

work on circle tool

#pragma once
#include <QWidget>
#include "../main.h"
#include "../model.h"

class Document;

class ObjectEditor : public QWidget
{
	Q_OBJECT
public:
	explicit ObjectEditor(Document* document, ldraw::id_t id = ldraw::NULL_ID);
	~ObjectEditor();
	void setObjectId(ldraw::id_t id);
private:
	Q_SLOT void handleColorChange(ldraw::Color value);
	Q_SLOT void handleVec3Change(const glm::vec3& value);
	Q_SLOT void handleBoolChange(bool value);
	Q_SLOT void handleStringChange(const QString& value);
	class Ui_ObjectEditor& ui;
	Document* const document;
	ldraw::id_t objectId = ldraw::NULL_ID;
	QMap<ldraw::Property, QPair<QWidget*, QWidget*>> propertyWidgets;
	QWidget* makeEditorWidgetForProperty(ldraw::Property property);
	void handlePropertyChange(QObject* caller, const QVariant& value);
};

mercurial