Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
KCacheGrind
Commits
c5fe5de8
Commit
c5fe5de8
authored
Sep 21, 2020
by
Calvin Buckley
🤔
Committed by
Albert Astals Cid
Nov 06, 2020
Browse files
Fix dock menu only checking one specific item
parent
0df27b4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
qcachegrind/qcgtoplevel.cpp
View file @
c5fe5de8
...
...
@@ -1858,13 +1858,19 @@ void QCGTopLevel::partsUnhideAllSlot()
void
QCGTopLevel
::
insertWindowList
(
QMenu
*
menu
)
{
auto
windowList
=
QApplication
::
topLevelWidgets
();
auto
activeWindow
=
QApplication
::
activeWindow
();
// dock menu this corresponds to (IIRC) last window that installed one,
// so using it unless we have to is a bad idea
if
(
activeWindow
==
nullptr
)
{
activeWindow
=
this
;
}
for
(
int
i
=
0
;
i
<
windowList
.
size
();
i
++
)
{
QWidget
*
topLevelRaw
=
windowList
[
i
];
if
(
QCGTopLevel
*
topLevel
=
qobject_cast
<
QCGTopLevel
*>
(
topLevelRaw
))
{
QString
windowTitle
=
topLevel
->
windowTitle
();
QAction
*
windowItem
=
menu
->
addAction
(
windowTitle
);
windowItem
->
setData
(
QVariant
::
fromValue
(
topLevel
));
if
(
topLevel
==
this
)
{
if
(
topLevel
==
activeWindow
)
{
windowItem
->
setCheckable
(
true
);
windowItem
->
setChecked
(
true
);
}
...
...
Write
Preview
Supports
Markdown
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