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
0659559a
Commit
0659559a
authored
Jul 13, 2010
by
Kai Koehne
Browse files
CppEditor: Select also non-root items in the combo box
Temporarily setting setRootModelIndex allows us to do so.
parent
97444004
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
0659559a
...
...
@@ -1115,16 +1115,20 @@ void CPPEditor::updateOutlineIndexNow()
m_updateOutlineIndexTimer
->
stop
();
m_outlineModelIndex
=
QModelIndex
();
//invalidate
// ComboBox only let's you select top level indexes!
QModelIndex
comboIndex
=
outlineModelIndex
();
while
(
comboIndex
.
parent
().
isValid
())
comboIndex
=
comboIndex
.
parent
();
if
(
comboIndex
.
isValid
())
{
bool
blocked
=
m_outlineCombo
->
blockSignals
(
true
);
// There is no direct way to select a non-root item
m_outlineCombo
->
setRootModelIndex
(
m_proxyModel
->
mapFromSource
(
comboIndex
.
parent
()));
m_outlineCombo
->
setCurrentIndex
(
m_proxyModel
->
mapFromSource
(
comboIndex
).
row
());
m_outlineCombo
->
setRootModelIndex
(
QModelIndex
());
updateOutlineToolTip
();
(
void
)
m_outlineCombo
->
blockSignals
(
blocked
);
m_outlineCombo
->
blockSignals
(
blocked
);
}
}
...
...
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