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
0659559a
Commit
0659559a
authored
Jul 13, 2010
by
Kai Koehne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/plugins/cppeditor/cppeditor.cpp
src/plugins/cppeditor/cppeditor.cpp
+8
-4
No files found.
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