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
45e7ccc0
Commit
45e7ccc0
authored
Mar 19, 2009
by
hjk
Browse files
debugger: make assignment of simple types work again
parent
00be6870
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggermanager.cpp
View file @
45e7ccc0
...
...
@@ -966,7 +966,10 @@ void DebuggerManager::exitDebugger()
void
DebuggerManager
::
assignValueInDebugger
()
{
if
(
QAction
*
action
=
qobject_cast
<
QAction
*>
(
sender
()))
{
qDebug
()
<<
"HANDLING "
<<
action
->
data
().
toString
();
QString
str
=
action
->
data
().
toString
();
int
i
=
str
.
indexOf
(
'='
);
if
(
i
!=
-
1
)
assignValueInDebugger
(
str
.
left
(
i
),
str
.
mid
(
i
+
1
));
}
}
void
DebuggerManager
::
assignValueInDebugger
(
const
QString
&
expr
,
const
QString
&
value
)
...
...
src/plugins/debugger/watchhandler.cpp
View file @
45e7ccc0
...
...
@@ -440,9 +440,6 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const
const
WatchData
&
data
=
m_displaySet
.
at
(
node
);
switch
(
role
)
{
case
Qt
::
EditRole
:
return
data
.
exp
;
case
Qt
::
DisplayRole
:
{
switch
(
idx
.
column
())
{
case
0
:
return
data
.
name
;
...
...
@@ -496,6 +493,9 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const
break
;
}
case
ExpressionRole
:
return
data
.
exp
;
case
INameRole
:
return
data
.
iname
;
...
...
src/plugins/debugger/watchhandler.h
View file @
45e7ccc0
...
...
@@ -132,7 +132,7 @@ public:
bool
changed
;
};
enum
{
INameRole
=
Qt
::
UserRole
,
VisualRole
,
ExpandedRole
};
enum
{
INameRole
=
Qt
::
UserRole
,
ExpressionRole
,
VisualRole
,
ExpandedRole
};
class
WatchHandler
:
public
QAbstractItemModel
...
...
src/plugins/debugger/watchwindow.cpp
View file @
45e7ccc0
...
...
@@ -54,7 +54,7 @@ using namespace Debugger::Internal;
//
/////////////////////////////////////////////////////////////////////
enum
{
INameRole
=
Qt
::
UserRole
,
VisualRole
,
ExpandedRole
};
enum
{
INameRole
=
Qt
::
UserRole
,
ExpressionRole
,
VisualRole
,
ExpandedRole
};
class
WatchDelegate
:
public
QItemDelegate
{
...
...
@@ -71,7 +71,10 @@ public:
{
QLineEdit
*
lineEdit
=
qobject_cast
<
QLineEdit
*>
(
editor
);
QTC_ASSERT
(
lineEdit
,
return
);
lineEdit
->
setText
(
index
.
model
()
->
data
(
index
,
Qt
::
EditRole
).
toString
());
if
(
index
.
column
()
==
1
)
lineEdit
->
setText
(
index
.
model
()
->
data
(
index
,
Qt
::
DisplayRole
).
toString
());
else
lineEdit
->
setText
(
index
.
model
()
->
data
(
index
,
ExpressionRole
).
toString
());
}
void
setModelData
(
QWidget
*
editor
,
QAbstractItemModel
*
,
...
...
@@ -80,7 +83,7 @@ public:
QLineEdit
*
lineEdit
=
qobject_cast
<
QLineEdit
*>
(
editor
);
QTC_ASSERT
(
lineEdit
,
return
);
QString
value
=
lineEdit
->
text
();
QString
exp
=
index
.
model
()
->
data
(
index
,
Qt
::
Edit
Role
).
toString
();
QString
exp
=
index
.
model
()
->
data
(
index
,
Expression
Role
).
toString
();
if
(
index
.
column
()
==
1
)
{
// the value column
theDebuggerSetting
(
AssignValue
)
->
trigger
(
exp
+
'='
+
value
);
...
...
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