Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
5ed71055
Commit
5ed71055
authored
Dec 16, 2010
by
hjk
Browse files
Options
Downloads
Patches
Plain Diff
debugger: merge the 'Change Format for {Object,Type}' l&w context menu entries
parent
e8c228b2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/debugger/watchwindow.cpp
+43
-52
43 additions, 52 deletions
src/plugins/debugger/watchwindow.cpp
with
43 additions
and
52 deletions
src/plugins/debugger/watchwindow.cpp
+
43
−
52
View file @
5ed71055
...
@@ -274,63 +274,55 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
...
@@ -274,63 +274,55 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
const
int
effectiveIndividualFormat
=
const
int
effectiveIndividualFormat
=
individualFormat
==
-
1
?
typeFormat
:
individualFormat
;
individualFormat
==
-
1
?
typeFormat
:
individualFormat
;
QMenu
typeF
ormatMenu
;
QMenu
f
ormatMenu
;
QList
<
QAction
*>
typeFormatActions
;
QList
<
QAction
*>
typeFormatActions
;
QList
<
QAction
*>
individualFormatActions
;
QAction
*
clearTypeFormatAction
=
0
;
QAction
*
clearTypeFormatAction
=
0
;
if
(
idx
.
isValid
())
{
QAction
*
clearIndividualFormatAction
=
0
;
typeFormatMenu
.
setTitle
(
formatMenu
.
setTitle
(
tr
(
"Change Display Format..."
));
if
(
idx
.
isValid
()
&&
!
alternativeFormats
.
isEmpty
())
{
QAction
*
dummy
=
formatMenu
.
addAction
(
tr
(
"Change Display for Type
\"
%1
\"
"
).
arg
(
type
));
tr
(
"Change Display for Type
\"
%1
\"
"
).
arg
(
type
));
if
(
alternativeFormats
.
isEmpty
())
{
dummy
->
setEnabled
(
false
);
typeF
ormatMenu
.
setEnabled
(
false
);
f
ormatMenu
.
addSeparator
(
);
}
else
{
clearTypeFormatAction
=
formatMenu
.
addAction
(
tr
(
"Automatic"
));
clearTypeFormatAction
=
typeFormatMenu
.
addAction
(
tr
(
"Automatic"
)
);
//
clearTypeFormatAction
->setEnabled(typeFormat != -1
);
clearTypeFormatAction
->
setEnabled
(
type
Format
!=
-
1
);
//
clearTypeFormatAction->setEnabled(
individual
Format != -1);
clearTypeFormatAction
->
setCheckable
(
true
);
clearTypeFormatAction
->
setCheckable
(
true
);
clearTypeFormatAction
->
setChecked
(
typeFormat
==
-
1
);
clearTypeFormatAction
->
setChecked
(
typeFormat
==
-
1
);
typeF
ormatMenu
.
addSeparator
();
f
ormatMenu
.
addSeparator
();
for
(
int
i
=
0
;
i
!=
alternativeFormats
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
!=
alternativeFormats
.
size
();
++
i
)
{
const
QString
format
=
alternativeFormats
.
at
(
i
);
const
QString
format
=
alternativeFormats
.
at
(
i
);
QAction
*
act
=
new
QAction
(
format
,
&
typeF
ormatMenu
);
QAction
*
act
=
new
QAction
(
format
,
&
f
ormatMenu
);
act
->
setCheckable
(
true
);
act
->
setCheckable
(
true
);
//act->setEnabled(individualFormat != -1);
if
(
i
==
typeFormat
)
if
(
i
==
typeFormat
)
act
->
setChecked
(
true
);
act
->
setChecked
(
true
);
typeF
ormatMenu
.
addAction
(
act
);
f
ormatMenu
.
addAction
(
act
);
typeFormatActions
.
append
(
act
);
typeFormatActions
.
append
(
act
);
}
}
}
formatMenu
.
addSeparator
();
}
else
{
dummy
=
formatMenu
.
addAction
(
typeFormatMenu
.
setTitle
(
tr
(
"Change Display for Type"
));
typeFormatMenu
.
setEnabled
(
false
);
}
QMenu
individualFormatMenu
;
QList
<
QAction
*>
individualFormatActions
;
QAction
*
clearIndividualFormatAction
=
0
;
if
(
idx
.
isValid
())
{
individualFormatMenu
.
setTitle
(
tr
(
"Change Display for Object Named
\"
%1
\"
"
).
arg
(
mi0
.
data
().
toString
()));
tr
(
"Change Display for Object Named
\"
%1
\"
"
).
arg
(
mi0
.
data
().
toString
()));
if
(
alternativeFormats
.
isEmpty
())
{
dummy
->
setEnabled
(
false
);
individualFormatMenu
.
setEnabled
(
false
);
formatMenu
.
addSeparator
();
}
else
{
clearIndividualFormatAction
clearIndividualFormatAction
=
individualF
ormatMenu
.
addAction
(
tr
(
"
Automatic
"
));
=
f
ormatMenu
.
addAction
(
tr
(
"
Use Display Format Based on Type
"
));
clearIndividualFormatAction
->
setEnabled
(
individualFormat
!=
-
1
);
//
clearIndividualFormatAction->setEnabled(individualFormat != -1);
clearIndividualFormatAction
->
setCheckable
(
true
);
clearIndividualFormatAction
->
setCheckable
(
true
);
clearIndividualFormatAction
->
setChecked
(
i
ndividualFormat
==
-
1
);
clearIndividualFormatAction
->
setChecked
(
effectiveI
ndividualFormat
==
-
1
);
individualF
ormatMenu
.
addSeparator
();
f
ormatMenu
.
addSeparator
();
for
(
int
i
=
0
;
i
!=
alternativeFormats
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
!=
alternativeFormats
.
size
();
++
i
)
{
const
QString
format
=
alternativeFormats
.
at
(
i
);
const
QString
format
=
alternativeFormats
.
at
(
i
);
QAction
*
act
=
new
QAction
(
format
,
&
individualF
ormatMenu
);
QAction
*
act
=
new
QAction
(
format
,
&
f
ormatMenu
);
act
->
setCheckable
(
true
);
act
->
setCheckable
(
true
);
if
(
i
==
effectiveIndividualFormat
)
if
(
i
==
effectiveIndividualFormat
)
act
->
setChecked
(
true
);
act
->
setChecked
(
true
);
individualF
ormatMenu
.
addAction
(
act
);
f
ormatMenu
.
addAction
(
act
);
individualFormatActions
.
append
(
act
);
individualFormatActions
.
append
(
act
);
}
}
}
}
else
{
}
else
{
individualFormatMenu
.
setTitle
(
tr
(
"Change Display for Object"
));
formatMenu
.
setEnabled
(
false
);
individualFormatMenu
.
setEnabled
(
false
);
}
}
const
bool
actionsEnabled
=
engine
->
debuggerActionsEnabled
();
const
bool
actionsEnabled
=
engine
->
debuggerActionsEnabled
();
...
@@ -406,8 +398,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
...
@@ -406,8 +398,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
menu
.
addAction
(
actInsertNewWatchItem
);
menu
.
addAction
(
actInsertNewWatchItem
);
menu
.
addAction
(
actSelectWidgetToWatch
);
menu
.
addAction
(
actSelectWidgetToWatch
);
menu
.
addMenu
(
&
typeFormatMenu
);
menu
.
addMenu
(
&
formatMenu
);
menu
.
addMenu
(
&
individualFormatMenu
);
if
(
actOpenMemoryEditAtVariableAddress
)
if
(
actOpenMemoryEditAtVariableAddress
)
menu
.
addAction
(
actOpenMemoryEditAtVariableAddress
);
menu
.
addAction
(
actOpenMemoryEditAtVariableAddress
);
if
(
actOpenMemoryEditAtPointerValue
)
if
(
actOpenMemoryEditAtPointerValue
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment