timeline/various: implemented block copy/paste
Implemented the ability to copy/paste blocks/clips in the timeline. This did require some large scale changes and reworking of the copy/paste system introduced a few commits ago, but should be largely functional now.
This commit is contained in:
@@ -143,7 +143,7 @@ void NodeView::CopySelected(bool cut)
|
||||
return;
|
||||
}
|
||||
|
||||
Core::instance()->CopyNodesToClipboard(selected);
|
||||
CopyNodesToClipboard(selected);
|
||||
|
||||
if (cut) {
|
||||
DeleteSelected();
|
||||
@@ -156,7 +156,11 @@ void NodeView::Paste()
|
||||
return;
|
||||
}
|
||||
|
||||
QList<Node*> pasted_nodes = Core::instance()->PasteNodesFromClipboard(static_cast<Sequence*>(graph_));
|
||||
QUndoCommand* command = new QUndoCommand();
|
||||
|
||||
QList<Node*> pasted_nodes = PasteNodesFromClipboard(static_cast<Sequence*>(graph_), command);
|
||||
|
||||
Core::instance()->undo_stack()->pushIfHasChildren(command);
|
||||
|
||||
if (!pasted_nodes.isEmpty()) {
|
||||
// FIXME: Attach to cursor so user can drop in place
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "node/graph.h"
|
||||
#include "nodeviewscene.h"
|
||||
#include "widget/nodecopypaste/nodecopypaste.h"
|
||||
|
||||
/**
|
||||
* @brief A widget for viewing and editing node graphs
|
||||
@@ -33,7 +34,7 @@
|
||||
* This widget takes a NodeGraph object and constructs a QGraphicsScene representing its data, viewing and allowing
|
||||
* the user to make modifications to it.
|
||||
*/
|
||||
class NodeView : public QGraphicsView
|
||||
class NodeView : public QGraphicsView, public NodeCopyPasteWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user