src/modeleditcontext.h

Sat, 14 Dec 2019 23:00:01 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 14 Dec 2019 23:00:01 +0200
changeset 20
cef43609a374
parent 14
20d2ed3af73d
child 24
1a0faaaceb84
permissions
-rw-r--r--

fixed build

#pragma once
#include "model.h"
#include "linetypes/object.h"

class Model::EditContext
{
public:
	template<typename T, typename... Args>
	T* append(Args&&... args);
	void append(std::unique_ptr<linetypes::Object>&& object);
	template<typename T, typename... Args>
	T* insert(int position, Args&&... args);
	void setObjectProperty(
		linetypes::Object* object,
		linetypes::Property property,
		const QVariant &value);
private:
	EditContext(Model& model);
	friend class Model;
	Model& model;
};

template<typename T, typename... Args>
T* Model::EditContext::append(Args&&... args)
{
	return this->model.append<T>(args...);
}

template<typename T, typename... Args>
T* Model::EditContext::insert(int position, Args&&... args)
{
	return this->model.insert<T>(position, args...);
}

mercurial