summaryrefslogtreecommitdiff
path: root/src/libs/modelinglib/qmt/model_controller/modelcontroller.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/modelinglib/qmt/model_controller/modelcontroller.h')
-rw-r--r--src/libs/modelinglib/qmt/model_controller/modelcontroller.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libs/modelinglib/qmt/model_controller/modelcontroller.h b/src/libs/modelinglib/qmt/model_controller/modelcontroller.h
index 345d5c0ce9..5b95d2a575 100644
--- a/src/libs/modelinglib/qmt/model_controller/modelcontroller.h
+++ b/src/libs/modelinglib/qmt/model_controller/modelcontroller.h
@@ -61,6 +61,13 @@ class QMT_EXPORT ModelController : public QObject
class MoveRelationCommand;
public:
+
+ enum PasteOption {
+ PasteAlwaysWithNewKeys,
+ PasteAlwaysAndKeepKeys,
+ PasteOnlyNewElements
+ };
+
explicit ModelController(QObject *parent = nullptr);
~ModelController() override;
@@ -93,8 +100,9 @@ public:
UndoController *undoController() const { return m_undoController; }
void setUndoController(UndoController *undoController);
+ Uid ownerKey(const Uid &key) const;
Uid ownerKey(const MElement *element) const;
- MElement *findElement(const Uid &key);
+ MElement *findElement(const Uid &key) const;
template<class T>
T *findElement(const Uid &key) { return dynamic_cast<T *>(findElement(key)); }
@@ -124,7 +132,7 @@ public:
MContainer cutElements(const MSelection &modelSelection);
MContainer copyElements(const MSelection &modelSelection);
- void pasteElements(MObject *owner, const MContainer &modelContainer);
+ void pasteElements(MObject *owner, const MReferences &modelContainer, PasteOption option);
void deleteElements(const MSelection &modelSelection);
private: