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
Marco Bubke
flatpak-qt-creator
Commits
40623d00
Commit
40623d00
authored
Jun 28, 2010
by
con
Browse files
Handle action containers with custom QActions more gracefully.
Related to QTCREATORBUG-1764.
parent
66e01e88
Changes
1
Show whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/actionmanager/actioncontainer.cpp
View file @
40623d00
...
...
@@ -390,8 +390,10 @@ bool MenuActionContainer::updateInternal()
return
true
;
bool
hasitems
=
false
;
QList
<
QAction
*>
actions
=
m_menu
->
actions
();
foreach
(
ActionContainer
*
container
,
subContainers
())
{
actions
.
removeAll
(
container
->
menu
()
->
menuAction
());
if
(
container
==
this
)
{
qWarning
()
<<
Q_FUNC_INFO
<<
"container"
<<
(
this
->
menu
()
?
this
->
menu
()
->
title
()
:
""
)
<<
"contains itself as subcontainer"
;
continue
;
...
...
@@ -403,12 +405,22 @@ bool MenuActionContainer::updateInternal()
}
if
(
!
hasitems
)
{
foreach
(
Command
*
command
,
commands
())
{
actions
.
removeAll
(
command
->
action
());
if
(
command
->
isActive
())
{
hasitems
=
true
;
break
;
}
}
}
if
(
!
hasitems
)
{
// look if there were actions added that we don't control and check if they are enabled
foreach
(
const
QAction
*
action
,
actions
)
{
if
(
!
action
->
isSeparator
()
&&
action
->
isEnabled
())
{
hasitems
=
true
;
break
;
}
}
}
if
(
hasEmptyAction
(
EA_Hide
))
m_menu
->
setVisible
(
hasitems
);
...
...
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