Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
f6b3e27f
Commit
f6b3e27f
authored
Feb 16, 2021
by
Vincent Pinon
Browse files
Apply
!180
fixing
#165
parents
ebb65fc9
0b5046ff
Pipeline
#51268
passed with stage
in 10 minutes and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/titler/graphicsscenerectmove.cpp
View file @
f6b3e27f
...
...
@@ -67,7 +67,8 @@ MyTextItem::MyTextItem(const QString &txt, QGraphicsItem *parent)
:
QGraphicsTextItem
(
txt
,
parent
)
,
m_alignment
(
qApp
->
isLeftToRight
()
?
Qt
::
AlignRight
:
Qt
::
AlignLeft
)
{
setCacheMode
(
QGraphicsItem
::
ItemCoordinateCache
);
//Disabled because cache makes text cursor invisible and borders ugly
//setCacheMode(QGraphicsItem::ItemCoordinateCache);
setFlag
(
QGraphicsItem
::
ItemSendsGeometryChanges
,
true
);
document
()
->
setDocumentMargin
(
0
);
m_shadowEffect
=
new
MyQGraphicsEffect
(
this
);
...
...
@@ -409,6 +410,7 @@ void MyTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *evt)
// SetTextInteraction(true);
setTextInteractionFlags
(
Qt
::
TextEditorInteraction
);
setFocus
(
Qt
::
MouseFocusReason
);
setCursor
(
QCursor
(
Qt
::
IBeamCursor
));
// 2. send a single click to this QGraphicsTextItem (this will set the cursor to the mouse position):
// create a new mouse event with the same parameters as evt
auto
*
click
=
new
QGraphicsSceneMouseEvent
(
QEvent
::
GraphicsSceneMousePress
);
...
...
@@ -421,7 +423,8 @@ void MyTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *evt)
MyRectItem
::
MyRectItem
(
QGraphicsItem
*
parent
)
:
QGraphicsRectItem
(
parent
)
{
setCacheMode
(
QGraphicsItem
::
ItemCoordinateCache
);
//Disabled because cache makes text cursor invisible and borders ugly
//setCacheMode(QGraphicsItem::ItemCoordinateCache);
setFlag
(
QGraphicsItem
::
ItemSendsGeometryChanges
,
true
);
}
...
...
@@ -454,7 +457,8 @@ QVariant MyRectItem::itemChange(GraphicsItemChange change, const QVariant &value
MyPixmapItem
::
MyPixmapItem
(
const
QPixmap
&
pixmap
,
QGraphicsItem
*
parent
)
:
QGraphicsPixmapItem
(
pixmap
,
parent
)
{
setCacheMode
(
QGraphicsItem
::
ItemCoordinateCache
);
//Disabled because cache makes text cursor invisible and borders ugly
//setCacheMode(QGraphicsItem::ItemCoordinateCache);
setFlag
(
QGraphicsItem
::
ItemSendsGeometryChanges
,
true
);
}
...
...
@@ -477,7 +481,8 @@ QVariant MyPixmapItem::itemChange(GraphicsItemChange change, const QVariant &val
MySvgItem
::
MySvgItem
(
const
QString
&
fileName
,
QGraphicsItem
*
parent
)
:
QGraphicsSvgItem
(
fileName
,
parent
)
{
setCacheMode
(
QGraphicsItem
::
ItemCoordinateCache
);
//Disabled because cache makes text cursor invisible and borders ugly
//setCacheMode(QGraphicsItem::ItemCoordinateCache);
setFlag
(
QGraphicsItem
::
ItemSendsGeometryChanges
,
true
);
}
...
...
@@ -792,6 +797,7 @@ void GraphicsSceneRectMove::clearTextSelection(bool reset)
QTextBlock
cur
=
t
->
textCursor
().
block
();
t
->
setTextCursor
(
QTextCursor
(
cur
));
t
->
setTextInteractionFlags
(
Qt
::
NoTextInteraction
);
t
->
unsetCursor
();
}
if
(
reset
)
{
m_selectedItem
=
nullptr
;
...
...
Write
Preview
Supports
Markdown
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