Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
261
Issues
261
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
856e3f2d
Commit
856e3f2d
authored
Jan 06, 2021
by
Jean-Baptiste Mardelle
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable crashing context menu in title widget
Related to
#912
parent
714e90d0
Pipeline
#46621
passed with stage
in 10 minutes and 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
src/titler/graphicsscenerectmove.cpp
src/titler/graphicsscenerectmove.cpp
+21
-12
src/titler/graphicsscenerectmove.h
src/titler/graphicsscenerectmove.h
+1
-0
No files found.
src/titler/graphicsscenerectmove.cpp
View file @
856e3f2d
...
...
@@ -506,6 +506,11 @@ GraphicsSceneRectMove::GraphicsSceneRectMove(QObject *parent)
m_fontSize
=
0
;
}
void
GraphicsSceneRectMove
::
contextMenuEvent
(
QGraphicsSceneContextMenuEvent
*
)
{
// Disable QGraphicsScene standard context menu that was crashing
}
void
GraphicsSceneRectMove
::
setSelectedItem
(
QGraphicsItem
*
item
)
{
clearSelection
();
...
...
@@ -758,18 +763,22 @@ void GraphicsSceneRectMove::mousePressEvent(QGraphicsSceneMouseEvent *e)
m_selectedItem
=
nullptr
;
e
->
ignore
();
}
else
if
(
m_tool
==
TITLE_TEXT
)
{
clearTextSelection
();
MyTextItem
*
textItem
=
new
MyTextItem
(
i18n
(
"Text"
),
nullptr
);
yPos
=
(((
int
)
e
->
scenePos
().
y
()
-
(
int
)(
m_fontSize
/
2
))
/
m_gridSize
)
*
m_gridSize
;
textItem
->
setPos
(
xPos
,
yPos
);
addItem
(
textItem
);
textItem
->
setFlags
(
QGraphicsItem
::
ItemIsMovable
|
QGraphicsItem
::
ItemIsSelectable
);
textItem
->
setTextInteractionFlags
(
Qt
::
TextEditorInteraction
);
textItem
->
setFocus
(
Qt
::
MouseFocusReason
);
emit
newText
(
textItem
);
m_selectedItem
=
textItem
;
m_selectedItem
->
setSelected
(
true
);
m_createdText
=
true
;
if
(
e
->
button
()
==
Qt
::
LeftButton
)
{
clearTextSelection
();
MyTextItem
*
textItem
=
new
MyTextItem
(
i18n
(
"Text"
),
nullptr
);
yPos
=
(((
int
)
e
->
scenePos
().
y
()
-
(
int
)(
m_fontSize
/
2
))
/
m_gridSize
)
*
m_gridSize
;
textItem
->
setPos
(
xPos
,
yPos
);
addItem
(
textItem
);
textItem
->
setFlags
(
QGraphicsItem
::
ItemIsMovable
|
QGraphicsItem
::
ItemIsSelectable
);
textItem
->
setTextInteractionFlags
(
Qt
::
TextEditorInteraction
);
textItem
->
setFocus
(
Qt
::
MouseFocusReason
);
emit
newText
(
textItem
);
m_selectedItem
=
textItem
;
m_selectedItem
->
setSelected
(
true
);
m_createdText
=
true
;
}
else
{
QGraphicsScene
::
mousePressEvent
(
e
);
}
}
// qCDebug(KDENLIVE_LOG) << "////// MOUSE CLICK, RESIZE MODE: " << m_resizeMode;
}
...
...
src/titler/graphicsscenerectmove.h
View file @
856e3f2d
...
...
@@ -142,6 +142,7 @@ protected:
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
)
override
;
void
wheelEvent
(
QGraphicsSceneWheelEvent
*
wheelEvent
)
override
;
void
drawForeground
(
QPainter
*
painter
,
const
QRectF
&
rect
)
override
;
void
contextMenuEvent
(
QGraphicsSceneContextMenuEvent
*
contextMenuEvent
)
override
;
private:
void
setCursor
(
const
QCursor
&
);
...
...
Eugen Mohr
@emohr
mentioned in issue
#820
·
Jan 07, 2021
mentioned in issue
#820
mentioned in issue #820
Toggle commit list
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