Fix several timeline selection issues (ctrl+click making clip disappear)

parent 6e857357
......@@ -56,6 +56,7 @@ const QString stopmotionMonitor("stopmotionMonitor");
enum OperationType {
None = 0,
WaitingForConfirm,
MoveOperation,
ResizeStart,
ResizeEnd,
......
......@@ -528,6 +528,27 @@ void AbstractClipItem::mousePressEvent(QGraphicsSceneMouseEvent * event)
}
}
// virtual
void AbstractClipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
{
if (event->modifiers() & Qt::ControlModifier) {
// User want to do a rectangle selection, so ignore the event to pass it to the view
event->ignore();
} else {
QGraphicsItem::mouseReleaseEvent(event);
}
}
void AbstractClipItem::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
{
if (event->buttons() != Qt::LeftButton || event->modifiers() & Qt::ControlModifier) {
// User want to do a rectangle selection, so ignore the event to pass it to the view
event->ignore();
} else {
QGraphicsItem::mouseMoveEvent(event);
}
}
int AbstractClipItem::itemHeight()
{
return 0;
......
......@@ -131,6 +131,8 @@ protected:
void drawKeyFrames(QPainter *painter, const QTransform &transformation);
int mouseOverKeyFrames(QPointF pos, double maxOffset);
void mousePressEvent(QGraphicsSceneMouseEvent * event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
void mouseMoveEvent(QGraphicsSceneMouseEvent * event);
int trackForPos(int position);
int posForTrack(int track);
};
......
......@@ -470,6 +470,27 @@ void AbstractGroupItem::mousePressEvent(QGraphicsSceneMouseEvent * event)
}
}
// virtual
void AbstractGroupItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
{
if (event->modifiers() & Qt::ControlModifier) {
// User want to do a rectangle selection, so ignore the event to pass it to the view
event->ignore();
} else {
QGraphicsItem::mouseReleaseEvent(event);
}
}
void AbstractGroupItem::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
{
if (event->buttons() != Qt::LeftButton || event->modifiers() & Qt::ControlModifier) {
// User want to do a rectangle selection, so ignore the event to pass it to the view
event->ignore();
} else {
QGraphicsItem::mouseMoveEvent(event);
}
}
void AbstractGroupItem::resizeStart(int diff)
{
bool info = false;
......
......@@ -68,6 +68,8 @@ protected:
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event);
int trackForPos(int position);
int posForTrack(int track);
......
This diff is collapsed.
......@@ -344,7 +344,9 @@ private:
QGraphicsLineItem *m_cursorLine;
ItemInfo m_dragItemInfo;
ItemInfo m_selectionGroupInfo;
/** @brief Possible timeline action */
OperationType m_operationMode;
/** @brief Currently running operation */
OperationType m_moveOpMode;
AbstractClipItem *m_dragItem;
Guide *m_dragGuide;
......@@ -505,6 +507,8 @@ private:
void reloadTimeline();
/** @brief Make sure our automatic composite transitions are correctly setup. */
void checkCompositeTransitions(Mlt::Tractor *tractor);
/** @brief Timeline selection changed, update effect stack. */
void updateTimelineSelection();
private slots:
void slotRefreshGuides();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment