src/openedmodel.h

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
permissions
-rw-r--r--

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

#ifndef OPENEDMODEL_H
#define OPENEDMODEL_H

#include <QObject>
#include "basics.h"
#include "gl/partrenderer.h"
#include "layers/edittools.h"
#include "layers/axeslayer.h"
#include "layers/gridlayer.h"

class EditableModel : public QObject
{
	Q_OBJECT
public:
	explicit EditableModel(QTextDocument* model, DocumentManager* documents, ColorTable* colorTable);
	std::unique_ptr<PartRenderer> canvas;
	std::unique_ptr<EditTools> tools;
	std::unique_ptr<AxesLayer> axesLayer;
	std::unique_ptr<GridLayer> gridLayer;
	std::unique_ptr<QTextCursor> textcursor;
	QTextDocument* const model;
	
Q_SIGNALS:
	void modelAction(const ModelAction& action);
	void select(std::int32_t linenumber);
	void newStatusText(const QString& newStatusText);
};

#endif // OPENEDMODEL_H

mercurial