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
Tobias Hunger
qt-creator
Commits
5266f16c
Commit
5266f16c
authored
Apr 03, 2009
by
hjk
Browse files
debugger: new test case for char arrays
parent
b4b23ea9
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggeractions.cpp
View file @
5266f16c
...
...
@@ -149,6 +149,9 @@ DebuggerSettings *theDebuggerSettings()
item
=
new
SavedAction
(
instance
);
instance
->
insertItem
(
AssignValue
,
item
);
item
=
new
SavedAction
(
instance
);
instance
->
insertItem
(
AssignType
,
item
);
item
=
new
SavedAction
(
instance
);
instance
->
insertItem
(
ExpandItem
,
item
);
item
->
setText
(
QObject
::
tr
(
"Expand item"
));
...
...
src/plugins/debugger/debuggeractions.h
View file @
5266f16c
...
...
@@ -86,6 +86,7 @@ enum DebuggerActionCode
WatchModelUpdate
,
UseToolTips
,
AssignValue
,
AssignType
,
ExpandItem
,
CollapseItem
,
...
...
src/plugins/debugger/watchhandler.cpp
View file @
5266f16c
...
...
@@ -520,9 +520,11 @@ Qt::ItemFlags WatchHandler::flags(const QModelIndex &idx) const
const
WatchData
&
data
=
m_displaySet
.
at
(
node
);
if
(
data
.
isWatcher
()
&&
idx
.
column
()
==
0
)
return
editable
;
// watcher names are
if
(
idx
.
column
()
==
1
)
return
editable
;
// values are editable
return
editable
;
// watcher names are editable
if
(
data
.
isWatcher
()
&&
idx
.
column
()
==
2
)
return
editable
;
// watcher types are
if
(
idx
.
column
()
==
1
)
return
editable
;
// locals and watcher values are editable
return
notEditable
;
}
...
...
src/plugins/debugger/watchwindow.cpp
View file @
5266f16c
...
...
@@ -87,6 +87,9 @@ public:
if
(
index
.
column
()
==
1
)
{
// the value column
theDebuggerAction
(
AssignValue
)
->
trigger
(
exp
+
'='
+
value
);
}
else
if
(
index
.
column
()
==
2
)
{
// the type column
theDebuggerAction
(
AssignType
)
->
trigger
(
exp
+
'='
+
value
);
}
else
if
(
index
.
column
()
==
0
)
{
// the watcher name column
theDebuggerAction
(
RemoveWatchExpression
)
->
trigger
(
exp
);
...
...
@@ -139,11 +142,16 @@ void WatchWindow::collapseNode(const QModelIndex &idx)
void
WatchWindow
::
keyPressEvent
(
QKeyEvent
*
ev
)
{
if
(
ev
->
key
()
==
Qt
::
Key_Delete
)
{
if
(
ev
->
key
()
==
Qt
::
Key_Delete
&&
m_type
==
WatchersType
)
{
QModelIndex
idx
=
currentIndex
();
QModelIndex
idx1
=
idx
.
sibling
(
idx
.
row
(),
0
);
QString
exp
=
model
()
->
data
(
idx1
).
toString
();
theDebuggerAction
(
RemoveWatchExpression
)
->
setValue
(
exp
);
theDebuggerAction
(
RemoveWatchExpression
)
->
trigger
(
exp
);
}
else
if
(
ev
->
key
()
==
Qt
::
Key_Return
&&
m_type
==
LocalsType
)
{
QModelIndex
idx
=
currentIndex
();
QModelIndex
idx1
=
idx
.
sibling
(
idx
.
row
(),
0
);
QString
exp
=
model
()
->
data
(
idx1
).
toString
();
theDebuggerAction
(
WatchExpression
)
->
trigger
(
exp
);
}
QTreeView
::
keyPressEvent
(
ev
);
}
...
...
tests/manual/gdbdebugger/simple/app.cpp
View file @
5266f16c
...
...
@@ -116,6 +116,12 @@ private:
void
testArray
()
{
char
c
[
20
];
c
[
0
]
=
'a'
;
c
[
1
]
=
'b'
;
c
[
2
]
=
'c'
;
c
[
3
]
=
'd'
;
QString
x
[
20
];
x
[
0
]
=
"a"
;
x
[
1
]
=
"b"
;
...
...
@@ -407,6 +413,10 @@ void testQObject(int &argc, char *argv[])
QAction
act
(
"xxx"
,
&
app
);
QString
t
=
act
.
text
();
t
+=
"y"
;
t
+=
"y"
;
t
+=
"y"
;
t
+=
"y"
;
t
+=
"y"
;
/*
QObject ob(&app);
...
...
tests/manual/gdbdebugger/simple/app/app.pro
View file @
5266f16c
...
...
@@ -8,4 +8,4 @@ DESTDIR = ..
SOURCES
+=
..
/
app
.
cpp
QT
+=
network
mesage
(
"this says <foo & bar>"
)
mes
s
age
(
"this says <foo & bar>"
)
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