Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLMC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
luyikei
VLMC
Commits
ba069876
Commit
ba069876
authored
Jun 21, 2009
by
Ludovic Fauvet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Items are moveable
parent
7e7080cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
src/gui/TracksView.cpp
src/gui/TracksView.cpp
+28
-0
src/gui/TracksView.h
src/gui/TracksView.h
+5
-0
No files found.
src/gui/TracksView.cpp
View file @
ba069876
...
...
@@ -47,6 +47,9 @@ TracksView::TracksView( QGraphicsScene* scene, MainWorkflow* mainWorkflow, QWidg
m_numVideoTrack
=
0
;
m_videoTracksCounter
=
MAX_TRACKS
;
m_dragItem
=
NULL
;
m_actionMove
=
false
;
m_actionRelativeX
=
-
1
;
m_actionItem
=
NULL
;
setMouseTracking
(
true
);
setAcceptDrops
(
true
);
...
...
@@ -300,6 +303,15 @@ void TracksView::drawBackground( QPainter* painter, const QRectF& rect )
void
TracksView
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
if
(
event
->
modifiers
()
==
Qt
::
NoModifier
&&
event
->
buttons
()
==
Qt
::
LeftButton
&&
m_actionMove
==
true
)
{
if
(
m_actionRelativeX
<
0
)
m_actionRelativeX
=
event
->
pos
().
x
()
-
mapFromScene
(
m_actionItem
->
pos
()
).
x
();
moveMediaItem
(
m_actionItem
,
QPoint
(
event
->
pos
().
x
()
-
m_actionRelativeX
,
event
->
pos
().
y
()
)
);
}
QGraphicsView
::
mouseMoveEvent
(
event
);
}
...
...
@@ -314,6 +326,15 @@ void TracksView::mousePressEvent( QMouseEvent* event )
return
;
}
if
(
event
->
modifiers
()
==
Qt
::
NoModifier
&&
event
->
button
()
==
Qt
::
LeftButton
&&
mediaCollisionList
.
count
()
==
1
)
{
m_actionMove
=
true
;
m_actionItem
=
mediaCollisionList
.
at
(
0
);
return
;
}
/*if ( event->modifiers() & Qt::ShiftModifier && collisionList.count() == 0 )
{
setDragMode( QGraphicsView::RubberBandDrag );
...
...
@@ -328,6 +349,13 @@ void TracksView::mousePressEvent( QMouseEvent* event )
void
TracksView
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
if
(
m_actionMove
)
{
m_actionMove
=
false
;
m_actionRelativeX
=
-
1
;
m_actionItem
=
NULL
;
}
setDragMode
(
QGraphicsView
::
NoDrag
);
QGraphicsView
::
mouseReleaseEvent
(
event
);
}
...
...
src/gui/TracksView.h
View file @
ba069876
...
...
@@ -119,6 +119,11 @@ private:
GraphicsMovieItem
*
m_dragItem
;
QGraphicsWidget
*
m_separator
;
// Mouse actions on Medias
bool
m_actionMove
;
int
m_actionRelativeX
;
AbstractGraphicsMediaItem
*
m_actionItem
;
signals:
void
zoomIn
();
void
zoomOut
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment