Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
d0240235
Commit
d0240235
authored
Jul 06, 2009
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: use enum for formats instead of magic numbers
parent
c58ba011
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
src/plugins/debugger/watchhandler.cpp
src/plugins/debugger/watchhandler.cpp
+4
-3
src/plugins/debugger/watchhandler.h
src/plugins/debugger/watchhandler.h
+14
-0
No files found.
src/plugins/debugger/watchhandler.cpp
View file @
d0240235
...
...
@@ -515,12 +515,13 @@ static QString formattedValue(const WatchData &data,
if
(
isIntType
(
data
.
type
))
{
int
format
=
individualFormat
==
-
1
?
typeFormat
:
individualFormat
;
int
value
=
data
.
value
.
toInt
();
if
(
format
==
1
)
if
(
format
==
HexadecimalFormat
)
return
(
"(hex) "
)
+
QString
::
number
(
value
,
16
);
if
(
format
==
2
)
if
(
format
==
BinaryFormat
)
return
(
"(bin) "
)
+
QString
::
number
(
value
,
2
);
if
(
format
==
3
)
if
(
format
==
OctalFormat
)
return
(
"(oct) "
)
+
QString
::
number
(
value
,
8
);
return
data
.
value
;
}
return
data
.
value
;
...
...
src/plugins/debugger/watchhandler.h
View file @
d0240235
...
...
@@ -146,6 +146,20 @@ enum WatchRoles
IndividualFormatRole
};
enum
IntegerFormat
{
DecimalFormat
=
0
,
// keep that at 0 as default
HexadecimalFormat
,
BinaryFormat
,
OctalFormat
,
};
enum
DumpableFormat
{
PrettyFormat
=
0
,
// keep that at 0 as default
PlainFomat
,
};
class
WatchModel
:
public
QAbstractItemModel
{
Q_OBJECT
...
...
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