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
Tobias Hunger
qt-creator
Commits
bb3ff9c6
Commit
bb3ff9c6
authored
Dec 10, 2010
by
Thomas Hartmann
Browse files
QmlDesigner.dragAndDrop: use instancesCompleted instead of timer
parent
d6a2e2ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/formeditor/dragtool.cpp
View file @
bb3ff9c6
...
...
@@ -208,10 +208,15 @@ void DragTool::formEditorItemsChanged(const QList<FormEditorItem*> & itemList)
void
DragTool
::
instancesCompleted
(
const
QList
<
FormEditorItem
*>
&
itemList
)
{
foreach
(
FormEditorItem
*
item
,
itemList
)
if
(
item
->
qmlItemNode
()
==
m_dragNode
)
clearMoveDelay
();
}
void
DragTool
::
clearMoveDelay
()
{
if
(
!
m_blockMove
)
return
;
m_blockMove
=
false
;
if
(
m_dragNode
.
isValid
())
beginWithPoint
(
m_startPoint
);
...
...
@@ -253,7 +258,7 @@ void DragTool::dragEnterEvent(QGraphicsSceneDragDropEvent * event)
{
if
(
event
->
mimeData
()
->
hasFormat
(
"application/vnd.bauhaus.itemlibraryinfo"
)
||
event
->
mimeData
()
->
hasFormat
(
"application/vnd.bauhaus.libraryresource"
))
{
m_blockMove
=
false
;
if
(
event
->
mimeData
()
->
hasFormat
(
"application/vnd.bauhaus.itemlibraryinfo"
))
{
Q_ASSERT
(
!
event
->
mimeData
()
->
data
(
"application/vnd.bauhaus.itemlibraryinfo"
).
isEmpty
());
ItemLibraryEntry
itemLibraryEntry
=
itemLibraryEntryFromData
(
event
->
mimeData
()
->
data
(
"application/vnd.bauhaus.itemlibraryinfo"
));
...
...
@@ -340,7 +345,7 @@ void DragTool::dragMoveEvent(QGraphicsSceneDragDropEvent * event)
}
else
Q_ASSERT
(
false
);
m_blockMove
=
true
;
m_startPoint
=
event
->
scenePos
();
QTimer
::
singleShot
(
100
,
m_timerHandler
.
data
(),
SLOT
(
clearMoveDelay
()));
QTimer
::
singleShot
(
100
0
,
m_timerHandler
.
data
(),
SLOT
(
clearMoveDelay
()));
}
}
if
(
event
->
mimeData
()
->
hasFormat
(
"application/vnd.bauhaus.libraryresource"
))
{
...
...
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