本文整理汇总了C++中core::EditorManager::currentEditor方法的典型用法代码示例。如果您正苦于以下问题:C++ EditorManager::currentEditor方法的具体用法?C++ EditorManager::currentEditor怎么用?C++ EditorManager::currentEditor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::EditorManager
的用法示例。
在下文中一共展示了EditorManager::currentEditor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
ITextEditor *LineNumberFilter::currentTextEditor() const
{
Core::EditorManager *editorManager = Core::EditorManager::instance();
if (!editorManager->currentEditor())
return 0;
return qobject_cast<TextEditor::ITextEditor*>(editorManager->currentEditor());
}
示例2: openPreview
void QmlJSEditorPlugin::openPreview()
{
Core::EditorManager *em = Core::EditorManager::instance();
if (em->currentEditor() && em->currentEditor()->id() == Constants::C_QMLJSEDITOR_ID)
m_previewRunner->run(em->currentEditor()->file()->fileName());
}
示例3: findUsages
void CppPlugin::findUsages()
{
Core::EditorManager *em = Core::EditorManager::instance();
CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(em->currentEditor()->widget());
if (editor)
editor->findUsages();
}
示例4: renameSymbolUnderCursor
void CppPlugin::renameSymbolUnderCursor()
{
Core::EditorManager *em = Core::EditorManager::instance();
CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(em->currentEditor()->widget());
if (editor)
editor->renameSymbolUnderCursor();
}
示例5: jumpToDefinition
void CppPlugin::jumpToDefinition()
{
Core::EditorManager *em = Core::EditorManager::instance();
CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(em->currentEditor()->widget());
if (editor)
editor->jumpToDefinition();
}
示例6: openTypeHierarchy
void CppPlugin::openTypeHierarchy()
{
Core::EditorManager *em = Core::EditorManager::instance();
CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(em->currentEditor()->widget());
if (editor) {
Core::NavigationWidget *navigation = Core::NavigationWidget::instance();
navigation->activateSubWidget(QLatin1String(Constants::TYPE_HIERARCHY_ID));
emit typeHierarchyRequested();
}
}
示例7: quickFixNow
void CppPlugin::quickFixNow()
{
if (! m_currentEditor)
return;
Core::EditorManager *em = Core::EditorManager::instance();
CPPEditorWidget *currentEditor = qobject_cast<CPPEditorWidget*>(em->currentEditor()->widget());
if (CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(m_currentEditor->widget())) {
if (currentEditor == editor) {
if (editor->isOutdated())
m_quickFixTimer->start(QUICKFIX_INTERVAL);
else
TextEditor::CompletionSupport::instance()->
complete(m_currentEditor, TextEditor::QuickFixCompletion, true);
}
}
}
示例8: saveSettings
void CoolScroll::Internal::CoolScrollPlugin::onSettingChanged()
{
saveSettings();
Core::EditorManager* em = Core::EditorManager::instance();
QList<Core::IEditor*> editors = em->visibleEditors();
QList<Core::IEditor*>::iterator it = editors.begin();
// editors will update settings after next opening
for( ; it != editors.end(); ++it)
{
CoolScrollBar* bar = getEditorScrollBar(*it);
Q_ASSERT(bar);
bar->markStateDirty();
}
// update current editor right now
CoolScrollBar* bar = getEditorScrollBar(em->currentEditor());
Q_ASSERT(bar);
bar->fullUpdateSettings();
}