本文整理汇总了C++中core::EditorManager::openedEditors方法的典型用法代码示例。如果您正苦于以下问题:C++ EditorManager::openedEditors方法的具体用法?C++ EditorManager::openedEditors怎么用?C++ EditorManager::openedEditors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::EditorManager
的用法示例。
在下文中一共展示了EditorManager::openedEditors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gotoLocation
void QmlEngine::gotoLocation(const Location &location)
{
const QString fileName = location.fileName();
// TODO: QUrl::isLocalFile() once we depend on Qt 4.8
if (QUrl(fileName).scheme().compare(QLatin1String("file"), Qt::CaseInsensitive) == 0) {
// internal file from source files -> show generated .js
QTC_ASSERT(m_sourceDocuments.contains(fileName), return);
Core::IEditor *editor = 0;
Core::EditorManager *editorManager = Core::EditorManager::instance();
QString titlePattern = tr("JS Source for %1").arg(fileName);
//Check if there are open editors with the same title
QList<Core::IEditor *> editors = editorManager->openedEditors();
foreach (Core::IEditor *ed, editors) {
if (ed->displayName() == titlePattern) {
editor = ed;
break;
}
}
if (!editor) {
editor = Core::EditorManager::openEditorWithContents(QmlJSEditor::Constants::C_QMLJSEDITOR_ID,
&titlePattern);
if (editor) {
editor->setProperty(Constants::OPENED_BY_DEBUGGER, true);
}
updateEditor(editor, m_sourceDocuments.value(fileName));
}
Core::EditorManager::activateEditor(editor);
} else {