本文整理汇总了C++中core::EditorManager::addCurrentPositionToNavigationHistory方法的典型用法代码示例。如果您正苦于以下问题:C++ EditorManager::addCurrentPositionToNavigationHistory方法的具体用法?C++ EditorManager::addCurrentPositionToNavigationHistory怎么用?C++ EditorManager::addCurrentPositionToNavigationHistory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::EditorManager
的用法示例。
在下文中一共展示了EditorManager::addCurrentPositionToNavigationHistory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateTextCursor
void QmlJSOutlineWidget::updateTextCursor(const QModelIndex &index)
{
QModelIndex sourceIndex = m_filterModel->mapToSource(index);
AST::SourceLocation location = m_editor->outlineModel()->sourceLocation(sourceIndex);
if (!location.isValid())
return;
const QTextBlock lastBlock = m_editor->document()->lastBlock();
const uint textLength = lastBlock.position() + lastBlock.length();
if (location.offset >= textLength)
return;
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->cutForwardNavigationHistory();
editorManager->addCurrentPositionToNavigationHistory();
QTextCursor textCursor = m_editor->textCursor();
m_blockCursorSync = true;
textCursor.setPosition(location.offset);
m_editor->setTextCursor(textCursor);
m_editor->centerCursor();
m_editor->setFocus();
m_blockCursorSync = false;
}
示例2: slotDiffBrowse
void VCSBaseEditor::slotDiffBrowse(int index)
{
// goto diffed file as indicated by index/line number
if (index < 0 || index >= d->m_diffSections.size())
return;
const int lineNumber = d->m_diffSections.at(index);
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->addCurrentPositionToNavigationHistory();
gotoLine(lineNumber + 1, 0); // TextEdit uses 1..n convention
}
示例3: accept
void LineNumberFilter::accept(FilterEntry selection) const
{
ITextEditor *editor = currentTextEditor();
if (editor) {
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->addCurrentPositionToNavigationHistory();
editor->gotoLine(selection.internalData.toInt());
editor->widget()->setFocus();
Core::ModeManager::instance()->activateModeType(Core::Constants::MODE_EDIT_TYPE);
}
}
示例4: gotoSourceLocation
void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber)
{
if (lineNumber < 0 || fileUrl.isEmpty())
return;
#if 0
const QString fileName = QUrl(fileUrl).toLocalFile();
const QString projectFileName = d->m_projectFinder.findFile(fileName);
Core::EditorManager *editorManager = Core::EditorManager::instance();
Core::IEditor *editor = editorManager->openEditor(projectFileName);
TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor*>(editor);
if (textEditor) {
editorManager->addCurrentPositionToNavigationHistory();
textEditor->gotoLine(lineNumber);
textEditor->widget()->setFocus();
}
#endif
}
示例5: updateTextCursor
void CppOutlineWidget::updateTextCursor(const QModelIndex &proxyIndex)
{
QModelIndex index = m_proxyModel->mapToSource(proxyIndex);
CPlusPlus::Symbol *symbol = m_model->symbolFromIndex(index);
if (symbol) {
m_blockCursorSync = true;
if (debug)
qDebug() << "CppOutline - moving cursor to" << symbol->line() << symbol->column() - 1;
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->cutForwardNavigationHistory();
editorManager->addCurrentPositionToNavigationHistory();
// line has to be 1 based, column 0 based!
m_editor->gotoLine(symbol->line(), symbol->column() - 1);
m_editor->setFocus();
m_blockCursorSync = false;
}
}