Skip to content
GitLab
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
3e7d9bde
Commit
3e7d9bde
authored
Feb 22, 2011
by
hjk
Browse files
texteditor: directly call completion instead using ITextEditor interface
Reviewed-By: con
parent
e81e7324
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/texteditor/basetexteditor.cpp
View file @
3e7d9bde
...
...
@@ -538,16 +538,6 @@ void BaseTextEditorWidget::selectEncoding()
}
}
void
BaseTextEditorWidget
::
triggerCompletions
()
{
CompletionSupport
::
instance
()
->
complete
(
editor
(),
SemanticCompletion
,
true
);
}
void
BaseTextEditorWidget
::
triggerQuickFix
()
{
CompletionSupport
::
instance
()
->
complete
(
editor
(),
QuickFixCompletion
,
true
);
}
QString
BaseTextEditorWidget
::
msgTextTooLarge
(
quint64
size
)
{
return
tr
(
"The text is too large to be displayed (%1 MB)."
).
...
...
src/plugins/texteditor/basetexteditor.h
View file @
3e7d9bde
...
...
@@ -155,9 +155,6 @@ public:
BaseTextEditor
*
editor
()
const
;
ITextMarkable
*
markableInterface
()
const
;
virtual
void
triggerCompletions
();
virtual
void
triggerQuickFix
();
QChar
characterAt
(
int
pos
)
const
;
void
print
(
QPrinter
*
);
...
...
@@ -584,9 +581,6 @@ public:
QString
textAt
(
int
pos
,
int
length
)
const
;
inline
QChar
characterAt
(
int
pos
)
const
{
return
e
->
characterAt
(
pos
);
}
inline
void
triggerCompletions
()
{
e
->
triggerCompletions
();
}
// slot?
inline
void
triggerQuickFix
()
{
e
->
triggerQuickFix
();
}
// slot?
inline
ITextMarkable
*
markableInterface
()
{
return
e
->
markableInterface
();
}
void
setContextHelpId
(
const
QString
&
id
)
{
m_contextHelpId
=
id
;
}
...
...
src/plugins/texteditor/itexteditor.h
View file @
3e7d9bde
...
...
@@ -125,9 +125,6 @@ public:
/*! Selects text between current cursor position and \a toPos. */
virtual
void
select
(
int
toPos
)
=
0
;
virtual
void
triggerCompletions
()
=
0
;
virtual
void
triggerQuickFix
()
=
0
;
virtual
ITextMarkable
*
markableInterface
()
=
0
;
virtual
void
setContextHelpId
(
const
QString
&
)
=
0
;
...
...
src/plugins/texteditor/texteditorplugin.cpp
View file @
3e7d9bde
...
...
@@ -33,6 +33,7 @@
#include
"texteditorplugin.h"
#include
"completionsupport.h"
#include
"findinfiles.h"
#include
"findincurrentfile.h"
#include
"fontsettings.h"
...
...
@@ -217,7 +218,7 @@ void TextEditorPlugin::invokeCompletion()
Core
::
IEditor
*
iface
=
Core
::
EditorManager
::
instance
()
->
currentEditor
();
ITextEditor
*
editor
=
qobject_cast
<
ITextEditor
*>
(
iface
);
if
(
editor
)
editor
->
trigger
Completion
s
(
);
CompletionSupport
::
instance
()
->
complete
(
editor
,
Semantic
Completion
,
true
);
}
void
TextEditorPlugin
::
invokeQuickFix
()
...
...
@@ -225,7 +226,7 @@ void TextEditorPlugin::invokeQuickFix()
Core
::
IEditor
*
iface
=
Core
::
EditorManager
::
instance
()
->
currentEditor
();
ITextEditor
*
editor
=
qobject_cast
<
ITextEditor
*>
(
iface
);
if
(
editor
)
editor
->
triggerQuickFix
(
);
CompletionSupport
::
instance
()
->
complete
(
editor
,
QuickFixCompletion
,
true
);
}
void
TextEditorPlugin
::
updateSearchResultsFont
(
const
FontSettings
&
settings
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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