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
Tobias Hunger
qt-creator
Commits
96545632
Commit
96545632
authored
Mar 24, 2009
by
Thorbjørn Lindeijer
Browse files
Make links to functions much more responsive
By avoiding searching for the definition when it isn't necessary.
parent
f36ea678
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
96545632
...
...
@@ -587,7 +587,8 @@ void CPPEditor::switchDeclarationDefinition()
}
}
CPPEditor
::
Link
CPPEditor
::
findLinkAt
(
const
QTextCursor
&
cursor
)
CPPEditor
::
Link
CPPEditor
::
findLinkAt
(
const
QTextCursor
&
cursor
,
bool
lookupDefinition
)
{
Link
link
;
...
...
@@ -648,7 +649,7 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor)
Symbol
*
symbol
=
resolvedSymbols
.
first
().
second
;
if
(
symbol
)
{
Symbol
*
def
=
0
;
if
(
!
lastSymbol
->
isFunction
())
if
(
lookupDefinition
&&
!
lastSymbol
->
isFunction
())
def
=
findDefinition
(
symbol
);
link
=
linkToSymbol
(
def
?
def
:
symbol
);
...
...
@@ -822,7 +823,7 @@ void CPPEditor::mouseMoveEvent(QMouseEvent *e)
onText
=
cursorRect
(
nextPos
).
right
()
>=
e
->
x
();
}
const
Link
link
=
findLinkAt
(
cursor
);
const
Link
link
=
findLinkAt
(
cursor
,
false
);
if
(
onText
&&
!
link
.
fileName
.
isEmpty
())
{
QTextEdit
::
ExtraSelection
sel
;
...
...
src/plugins/cppeditor/cppeditor.h
View file @
96545632
...
...
@@ -148,7 +148,7 @@ private:
int
column
;
// Target column
};
Link
findLinkAt
(
const
QTextCursor
&
);
Link
findLinkAt
(
const
QTextCursor
&
,
bool
lookupDefinition
=
true
);
static
Link
linkToSymbol
(
CPlusPlus
::
Symbol
*
symbol
);
bool
openCppEditorAt
(
const
Link
&
);
QTextCharFormat
m_linkFormat
;
...
...
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