Make markers copy/paste-able
This commit is contained in:
@@ -106,6 +106,21 @@ const int &SeekableWidget::GetScroll() const
|
||||
return scroll_;
|
||||
}
|
||||
|
||||
void SeekableWidget::CopySelected(bool cut)
|
||||
{
|
||||
CopyMarkersToClipboard(GetActiveTimelineMarkers());
|
||||
|
||||
if (cut) {
|
||||
DeleteSelected();
|
||||
}
|
||||
}
|
||||
|
||||
void SeekableWidget::PasteMarkers(bool insert, rational insert_time)
|
||||
{
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
PasteMarkersFromClipboard(timeline_points()->markers(), command, insert_time);
|
||||
}
|
||||
|
||||
void SeekableWidget::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
|
||||
@@ -28,10 +28,11 @@
|
||||
#include "widget/snapservice/snapservice.h"
|
||||
#include "widget/timebased/timescaledobject.h"
|
||||
#include "widget/marker/marker.h"
|
||||
#include "widget/marker/markercopypaste.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class SeekableWidget : public TimelineScaledWidget
|
||||
class SeekableWidget : public TimelineScaledWidget, public MarkerCopyPasteService
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -55,6 +56,10 @@ public:
|
||||
|
||||
void DeleteSelected();
|
||||
|
||||
void CopySelected(bool cut);
|
||||
|
||||
void PasteMarkers(bool insert, rational insert_time);
|
||||
|
||||
QVector<TimelineMarker*> GetActiveTimelineMarkers();
|
||||
|
||||
void DeselectAllMarkers();
|
||||
|
||||
Reference in New Issue
Block a user