Skip to content
GitLab
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
b7fe1e79
Commit
b7fe1e79
authored
Dec 17, 2008
by
hjk
Browse files
some refactoring: make watchExpression/removeWatchExpression symmetric
wrt arguments
parent
02a679d9
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/breakwindow.cpp
View file @
b7fe1e79
...
...
@@ -62,24 +62,24 @@ BreakWindow::BreakWindow(QWidget *parent)
this
,
SLOT
(
rowActivated
(
QModelIndex
)));
}
void
BreakWindow
::
keyPressEvent
(
QKeyEvent
*
ev
ent
)
void
BreakWindow
::
keyPressEvent
(
QKeyEvent
*
ev
)
{
if
(
ev
ent
->
key
()
==
Qt
::
Key_Delete
)
if
(
ev
->
key
()
==
Qt
::
Key_Delete
)
deleteBreakpoint
(
currentIndex
());
QTreeView
::
keyPressEvent
(
ev
ent
);
QTreeView
::
keyPressEvent
(
ev
);
}
void
BreakWindow
::
resizeEvent
(
QResizeEvent
*
ev
ent
)
void
BreakWindow
::
resizeEvent
(
QResizeEvent
*
ev
)
{
QHeaderView
*
hv
=
header
();
int
totalSize
=
ev
ent
->
size
().
width
()
-
180
;
int
totalSize
=
ev
->
size
().
width
()
-
180
;
hv
->
resizeSection
(
0
,
60
);
hv
->
resizeSection
(
1
,
(
totalSize
*
30
)
/
100
);
hv
->
resizeSection
(
2
,
(
totalSize
*
30
)
/
100
);
hv
->
resizeSection
(
3
,
(
totalSize
*
30
)
/
100
);
hv
->
resizeSection
(
4
,
70
);
hv
->
resizeSection
(
5
,
50
);
QTreeView
::
resizeEvent
(
ev
ent
);
QTreeView
::
resizeEvent
(
ev
);
}
void
BreakWindow
::
contextMenuEvent
(
QContextMenuEvent
*
ev
)
...
...
src/plugins/debugger/debuggermanager.cpp
View file @
b7fe1e79
...
...
@@ -731,9 +731,9 @@ void DebuggerManager::collapseChildren(const QModelIndex &idx)
watchHandler
()
->
collapseChildren
(
idx
);
}
void
DebuggerManager
::
removeWatchExpression
(
const
QString
&
iname
)
void
DebuggerManager
::
removeWatchExpression
(
const
QString
&
exp
)
{
watchHandler
()
->
removeWatchExpression
(
iname
);
watchHandler
()
->
removeWatchExpression
(
exp
);
}
QVariant
DebuggerManager
::
sessionValue
(
const
QString
&
name
)
...
...
src/plugins/debugger/watchhandler.cpp
View file @
b7fe1e79
...
...
@@ -50,7 +50,7 @@
#include
<ctype.h>
// creates debug output regarding pending watch data results
//
#define DEBUG_PENDING 1
#define DEBUG_PENDING 1
// creates debug output for accesses to the itemmodel
//#define DEBUG_MODEL 1
...
...
@@ -964,12 +964,19 @@ void WatchHandler::showEditValue(const WatchData &data)
w
->
show
();
}
void
WatchHandler
::
removeWatchExpression
(
const
QString
&
iname
)
void
WatchHandler
::
removeWatchExpression
(
const
QString
&
exp
)
{
MODEL_DEBUG
(
"REMOVE WATCH: "
<<
iname
);
WatchData
data
=
takeData
(
iname
);
m_watchers
.
removeOne
(
data
.
iname
);
m_watchers
.
removeOne
(
exp
);
for
(
int
i
=
m_completeSet
.
size
();
--
i
>=
0
;)
{
const
WatchData
&
data
=
m_completeSet
.
at
(
i
);
if
(
data
.
iname
.
startsWith
(
"watch."
)
&&
data
.
exp
==
exp
)
{
m_completeSet
.
takeAt
(
i
);
break
;
}
}
saveWatchers
();
rebuildModel
();
emit
watchModelUpdateRequested
();
}
...
...
src/plugins/debugger/watchwindow.cpp
View file @
b7fe1e79
...
...
@@ -87,6 +87,17 @@ void WatchWindow::collapseNode(const QModelIndex &idx)
emit
requestCollapseChildren
(
idx
);
}
void
WatchWindow
::
keyPressEvent
(
QKeyEvent
*
ev
)
{
if
(
ev
->
key
()
==
Qt
::
Key_Delete
)
{
QModelIndex
idx
=
currentIndex
();
QModelIndex
idx1
=
idx
.
sibling
(
idx
.
row
(),
0
);
QString
exp
=
model
()
->
data
(
idx1
).
toString
();
emit
requestRemoveWatchExpression
(
exp
);
}
QTreeView
::
keyPressEvent
(
ev
);
}
void
WatchWindow
::
contextMenuEvent
(
QContextMenuEvent
*
ev
)
{
QMenu
menu
;
...
...
@@ -103,7 +114,6 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
QModelIndex
idx
=
indexAt
(
ev
->
pos
());
QModelIndex
mi0
=
idx
.
sibling
(
idx
.
row
(),
0
);
QString
exp
=
model
()
->
data
(
mi0
).
toString
();
QString
iname
=
model
()
->
data
(
mi0
,
INameRole
).
toString
();
QModelIndex
mi1
=
idx
.
sibling
(
idx
.
row
(),
0
);
QString
value
=
model
()
->
data
(
mi1
).
toString
();
bool
visual
=
false
;
...
...
@@ -134,7 +144,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
if
(
m_type
==
LocalsType
)
emit
requestWatchExpression
(
exp
);
else
emit
requestRemoveWatchExpression
(
iname
);
emit
requestRemoveWatchExpression
(
exp
);
else
if
(
act
==
act4
)
model
()
->
setData
(
mi0
,
!
visual
,
VisualRole
);
}
...
...
src/plugins/debugger/watchwindow.h
View file @
b7fe1e79
...
...
@@ -63,7 +63,7 @@ public slots:
signals:
void
requestWatchExpression
(
const
QString
&
exp
);
void
requestRemoveWatchExpression
(
const
QString
&
iname
);
void
requestRemoveWatchExpression
(
const
QString
&
exp
);
void
requestAssignValue
(
const
QString
&
exp
,
const
QString
&
value
);
void
requestExpandChildren
(
const
QModelIndex
&
idx
);
void
requestCollapseChildren
(
const
QModelIndex
&
idx
);
...
...
@@ -74,6 +74,7 @@ private slots:
void
collapseNode
(
const
QModelIndex
&
index
);
private:
void
keyPressEvent
(
QKeyEvent
*
ev
);
void
contextMenuEvent
(
QContextMenuEvent
*
ev
);
void
editItem
(
const
QModelIndex
&
idx
);
void
reset
();
/* reimpl */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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