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
1488062a
Commit
1488062a
authored
Aug 03, 2010
by
Roberto Raggi
Browse files
Force an update of the current editor.
parent
3a5ebf2b
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
1488062a
...
...
@@ -578,6 +578,12 @@ void CPPEditor::abortRename()
setExtraSelections
(
CodeSemanticsSelection
,
m_renameSelections
);
}
void
CPPEditor
::
rehighlight
(
bool
force
)
{
const
SemanticHighlighter
::
Source
source
=
currentSource
(
force
);
m_semanticHighlighter
->
rehighlight
(
source
);
}
void
CPPEditor
::
onDocumentUpdated
(
Document
::
Ptr
doc
)
{
if
(
doc
->
fileName
()
!=
file
()
->
fileName
())
...
...
@@ -588,9 +594,7 @@ void CPPEditor::onDocumentUpdated(Document::Ptr doc)
if
(
!
m_initialized
)
{
m_initialized
=
true
;
const
SemanticHighlighter
::
Source
source
=
currentSource
(
/*force = */
true
);
m_semanticHighlighter
->
rehighlight
(
source
);
rehighlight
(
/* force = */
true
);
}
m_updateOutlineTimer
->
start
();
...
...
src/plugins/cppeditor/cppeditor.h
View file @
1488062a
...
...
@@ -194,6 +194,7 @@ public Q_SLOTS:
void
findUsages
();
void
renameUsagesNow
(
const
QString
&
replacement
=
QString
());
void
hideRenameNotification
();
void
rehighlight
(
bool
force
=
false
);
protected:
bool
event
(
QEvent
*
e
);
...
...
src/plugins/cppeditor/cppplugin.cpp
View file @
1488062a
...
...
@@ -302,6 +302,9 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
this
,
SLOT
(
onTaskStarted
(
QString
)));
connect
(
core
->
progressManager
(),
SIGNAL
(
allTasksFinished
(
QString
)),
this
,
SLOT
(
onAllTasksFinished
(
QString
)));
connect
(
core
->
editorManager
(),
SIGNAL
(
currentEditorChanged
(
Core
::
IEditor
*
)),
SLOT
(
currentEditorChanged
(
Core
::
IEditor
*
)));
readSettings
();
return
true
;
}
...
...
@@ -400,4 +403,14 @@ void CppPlugin::onAllTasksFinished(const QString &type)
}
}
void
CppPlugin
::
currentEditorChanged
(
Core
::
IEditor
*
editor
)
{
if
(
!
editor
)
return
;
else
if
(
CPPEditor
*
textEditor
=
qobject_cast
<
CPPEditor
*>
(
editor
->
widget
()))
{
textEditor
->
rehighlight
(
/*force = */
true
);
}
}
Q_EXPORT_PLUGIN
(
CppPlugin
)
src/plugins/cppeditor/cppplugin.h
View file @
1488062a
...
...
@@ -84,6 +84,7 @@ private slots:
void
findUsages
();
void
quickFix
(
TextEditor
::
ITextEditable
*
editable
);
void
quickFixNow
();
void
currentEditorChanged
(
Core
::
IEditor
*
editor
);
private:
Core
::
IEditor
*
createEditor
(
QWidget
*
parent
);
...
...
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