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
Marco Bubke
flatpak-qt-creator
Commits
3cb783f7
Commit
3cb783f7
authored
Apr 29, 2009
by
hjk
Browse files
debugger: allow drag&drop from main editor to watchers view
parent
918cac90
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/watchwindow.cpp
View file @
3cb783f7
...
...
@@ -122,6 +122,9 @@ WatchWindow::WatchWindow(Type type, QWidget *parent)
setIndentation
(
indentation
()
*
9
/
10
);
setUniformRowHeights
(
true
);
setItemDelegate
(
new
WatchDelegate
(
this
));
setDragEnabled
(
true
);
setAcceptDrops
(
true
);
setDropIndicatorShown
(
true
);
connect
(
this
,
SIGNAL
(
expanded
(
QModelIndex
)),
this
,
SLOT
(
expandNode
(
QModelIndex
)));
...
...
@@ -161,6 +164,35 @@ void WatchWindow::keyPressEvent(QKeyEvent *ev)
QTreeView
::
keyPressEvent
(
ev
);
}
void
WatchWindow
::
dragEnterEvent
(
QDragEnterEvent
*
ev
)
{
//QTreeView::dragEnterEvent(ev);
if
(
ev
->
mimeData
()
->
hasFormat
(
"text/plain"
))
{
ev
->
setDropAction
(
Qt
::
CopyAction
);
ev
->
accept
();
}
}
void
WatchWindow
::
dragMoveEvent
(
QDragMoveEvent
*
ev
)
{
//QTreeView::dragMoveEvent(ev);
if
(
ev
->
mimeData
()
->
hasFormat
(
"text/plain"
))
{
ev
->
setDropAction
(
Qt
::
CopyAction
);
ev
->
accept
();
}
}
void
WatchWindow
::
dropEvent
(
QDropEvent
*
ev
)
{
if
(
ev
->
mimeData
()
->
hasFormat
(
"text/plain"
))
{
theDebuggerAction
(
WatchExpression
)
->
trigger
(
ev
->
mimeData
()
->
text
());
//ev->acceptProposedAction();
ev
->
setDropAction
(
Qt
::
CopyAction
);
ev
->
accept
();
}
//QTreeView::dropEvent(ev);
}
void
WatchWindow
::
contextMenuEvent
(
QContextMenuEvent
*
ev
)
{
QMenu
menu
;
...
...
src/plugins/debugger/watchwindow.h
View file @
3cb783f7
...
...
@@ -64,6 +64,10 @@ private:
void
keyPressEvent
(
QKeyEvent
*
ev
);
void
contextMenuEvent
(
QContextMenuEvent
*
ev
);
void
dragEnterEvent
(
QDragEnterEvent
*
ev
);
void
dropEvent
(
QDropEvent
*
ev
);
void
dragMoveEvent
(
QDragMoveEvent
*
ev
);
void
editItem
(
const
QModelIndex
&
idx
);
void
reset
();
/* reimpl */
...
...
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