Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ff2afcab
Commit
ff2afcab
authored
Mar 25, 2009
by
con
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort method combo box alphabetically.
Patch received by Kris Wong.
parent
5c9778e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
src/plugins/cppeditor/cppeditor.cpp
src/plugins/cppeditor/cppeditor.cpp
+10
-3
src/plugins/cppeditor/cppeditor.h
src/plugins/cppeditor/cppeditor.h
+2
-0
No files found.
src/plugins/cppeditor/cppeditor.cpp
View file @
ff2afcab
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
#include <QtGui/QTextEdit>
#include <QtGui/QTextEdit>
#include <QtGui/QComboBox>
#include <QtGui/QComboBox>
#include <QtGui/QTreeView>
#include <QtGui/QTreeView>
#include <QtGui/QSortFilterProxyModel>
using
namespace
CPlusPlus
;
using
namespace
CPlusPlus
;
using
namespace
CppEditor
::
Internal
;
using
namespace
CppEditor
::
Internal
;
...
@@ -239,11 +240,17 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable)
...
@@ -239,11 +240,17 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable)
QTreeView
*
methodView
=
new
OverviewTreeView
;
QTreeView
*
methodView
=
new
OverviewTreeView
;
methodView
->
header
()
->
hide
();
methodView
->
header
()
->
hide
();
methodView
->
setItemsExpandable
(
false
);
methodView
->
setItemsExpandable
(
false
);
methodView
->
setSortingEnabled
(
true
);
methodView
->
sortByColumn
(
0
,
Qt
::
AscendingOrder
);
m_methodCombo
->
setView
(
methodView
);
m_methodCombo
->
setView
(
methodView
);
m_methodCombo
->
setMaxVisibleItems
(
20
);
m_methodCombo
->
setMaxVisibleItems
(
20
);
m_overviewModel
=
new
OverviewModel
(
this
);
m_overviewModel
=
new
OverviewModel
(
this
);
m_methodCombo
->
setModel
(
m_overviewModel
);
m_proxyModel
=
new
QSortFilterProxyModel
(
this
);
m_proxyModel
->
setSourceModel
(
m_overviewModel
);
m_proxyModel
->
setDynamicSortFilter
(
true
);
m_proxyModel
->
setSortCaseSensitivity
(
Qt
::
CaseInsensitive
);
m_methodCombo
->
setModel
(
m_proxyModel
);
connect
(
m_methodCombo
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
jumpToMethod
(
int
)));
connect
(
m_methodCombo
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
jumpToMethod
(
int
)));
connect
(
this
,
SIGNAL
(
cursorPositionChanged
()),
this
,
SLOT
(
updateMethodBoxIndex
()));
connect
(
this
,
SIGNAL
(
cursorPositionChanged
()),
this
,
SLOT
(
updateMethodBoxIndex
()));
...
@@ -366,7 +373,7 @@ void CPPEditor::updateFileName()
...
@@ -366,7 +373,7 @@ void CPPEditor::updateFileName()
void
CPPEditor
::
jumpToMethod
(
int
)
void
CPPEditor
::
jumpToMethod
(
int
)
{
{
QModelIndex
index
=
m_
methodCombo
->
view
()
->
currentIndex
(
);
QModelIndex
index
=
m_
proxyModel
->
mapToSource
(
m_methodCombo
->
view
()
->
currentIndex
()
);
Symbol
*
symbol
=
m_overviewModel
->
symbolFromIndex
(
index
);
Symbol
*
symbol
=
m_overviewModel
->
symbolFromIndex
(
index
);
if
(
!
symbol
)
if
(
!
symbol
)
return
;
return
;
...
@@ -394,7 +401,7 @@ void CPPEditor::updateMethodBoxIndex()
...
@@ -394,7 +401,7 @@ void CPPEditor::updateMethodBoxIndex()
if
(
lastIndex
.
isValid
())
{
if
(
lastIndex
.
isValid
())
{
bool
blocked
=
m_methodCombo
->
blockSignals
(
true
);
bool
blocked
=
m_methodCombo
->
blockSignals
(
true
);
m_methodCombo
->
setCurrentIndex
(
lastIndex
.
row
());
m_methodCombo
->
setCurrentIndex
(
m_proxyModel
->
mapFromSource
(
lastIndex
)
.
row
());
updateMethodBoxToolTip
();
updateMethodBoxToolTip
();
(
void
)
m_methodCombo
->
blockSignals
(
blocked
);
(
void
)
m_methodCombo
->
blockSignals
(
blocked
);
}
}
...
...
src/plugins/cppeditor/cppeditor.h
View file @
ff2afcab
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
QT_BEGIN_NAMESPACE
QT_BEGIN_NAMESPACE
class
QComboBox
;
class
QComboBox
;
class
QSortFilterProxyModel
;
QT_END_NAMESPACE
QT_END_NAMESPACE
namespace
CPlusPlus
{
namespace
CPlusPlus
{
...
@@ -161,6 +162,7 @@ private:
...
@@ -161,6 +162,7 @@ private:
QList
<
int
>
m_contexts
;
QList
<
int
>
m_contexts
;
QComboBox
*
m_methodCombo
;
QComboBox
*
m_methodCombo
;
CPlusPlus
::
OverviewModel
*
m_overviewModel
;
CPlusPlus
::
OverviewModel
*
m_overviewModel
;
QSortFilterProxyModel
*
m_proxyModel
;
};
};
}
// namespace Internal
}
// namespace Internal
...
...
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