forked from qt-creator/qt-creator
Rename IContext::HelpIdCallback -> IContext::HelpCallback
It no longer takes an ID but a HelpItem. Change-Id: I0aa738549fea4fcfd0151adc2dfd642c63f0f60d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -60,7 +60,7 @@ namespace Internal {
|
||||
// CMakeEditor
|
||||
//
|
||||
|
||||
void CMakeEditor::contextHelp(const HelpIdCallback &callback) const
|
||||
void CMakeEditor::contextHelp(const HelpCallback &callback) const
|
||||
{
|
||||
int pos = position();
|
||||
|
||||
|
@@ -38,7 +38,7 @@ class CMakeEditor : public TextEditor::BaseTextEditor
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
void contextHelp(const HelpIdCallback &callback) const override;
|
||||
void contextHelp(const HelpCallback &callback) const override;
|
||||
|
||||
friend class CMakeEditorWidget;
|
||||
};
|
||||
|
@@ -74,8 +74,8 @@ public:
|
||||
|
||||
virtual Context context() const { return m_context; }
|
||||
virtual QWidget *widget() const { return m_widget; }
|
||||
using HelpIdCallback = std::function<void(const HelpItem &id)>;
|
||||
virtual void contextHelp(const HelpIdCallback &callback) const { callback(m_contextHelp); }
|
||||
using HelpCallback = std::function<void(const HelpItem &item)>;
|
||||
virtual void contextHelp(const HelpCallback &callback) const { callback(m_contextHelp); }
|
||||
|
||||
virtual void setContext(const Context &context) { m_context = context; }
|
||||
virtual void setWidget(QWidget *widget) { m_widget = widget; }
|
||||
|
@@ -45,7 +45,7 @@ DesignerContext::DesignerContext(const Core::Context &context,
|
||||
setWidget(widget);
|
||||
}
|
||||
|
||||
void DesignerContext::contextHelp(const HelpIdCallback &callback) const
|
||||
void DesignerContext::contextHelp(const HelpCallback &callback) const
|
||||
{
|
||||
const QDesignerFormEditorInterface *core = FormEditorW::designerEditor();
|
||||
callback(core->integration()->contextHelpId());
|
||||
|
@@ -37,7 +37,7 @@ public:
|
||||
QWidget *widget,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
void contextHelp(const HelpIdCallback &callback) const override;
|
||||
void contextHelp(const HelpCallback &callback) const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -333,7 +333,7 @@ double FormEditorWidget::containerPadding() const
|
||||
}
|
||||
|
||||
|
||||
void FormEditorWidget::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void FormEditorWidget::contextHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
if (m_formEditorView)
|
||||
m_formEditorView->contextHelpId(callback);
|
||||
|
@@ -64,7 +64,7 @@ public:
|
||||
double spacing() const;
|
||||
double containerPadding() const;
|
||||
|
||||
void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
|
||||
void contextHelpId(const Core::IContext::HelpCallback &callback) const;
|
||||
|
||||
void setRootItemRect(const QRectF &rect);
|
||||
QRectF rootItemRect() const;
|
||||
|
@@ -661,7 +661,7 @@ void DesignDocument::updateCurrentProject()
|
||||
viewManager().setNodeInstanceViewProject(currentProject);
|
||||
}
|
||||
|
||||
void DesignDocument::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void DesignDocument::contextHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
if (view())
|
||||
view()->contextHelpId(callback);
|
||||
|
@@ -77,7 +77,7 @@ public:
|
||||
Model *currentModel() const;
|
||||
Model *documentModel() const;
|
||||
|
||||
void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
|
||||
void contextHelpId(const Core::IContext::HelpCallback &callback) const;
|
||||
QList<DocumentMessage> qmlParseWarnings() const;
|
||||
bool hasQmlParseWarnings() const;
|
||||
QList<DocumentMessage> qmlParseErrors() const;
|
||||
|
@@ -158,7 +158,7 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
|
||||
return buttons;
|
||||
}
|
||||
|
||||
void NavigatorWidget::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void NavigatorWidget::contextHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
if (navigatorView())
|
||||
navigatorView()->contextHelpId(callback);
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
void setTreeModel(QAbstractItemModel *model);
|
||||
QTreeView *treeView() const;
|
||||
QList<QToolButton *> createToolBarWidgets();
|
||||
void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
|
||||
void contextHelpId(const Core::IContext::HelpCallback &callback) const;
|
||||
|
||||
void disableNavigator();
|
||||
void enableNavigator();
|
||||
|
@@ -152,12 +152,12 @@ WidgetInfo TextEditorView::widgetInfo()
|
||||
return createWidgetInfo(m_widget, nullptr, "TextEditor", WidgetInfo::CentralPane, 0, tr("Text Editor"), DesignerWidgetFlags::IgnoreErrors);
|
||||
}
|
||||
|
||||
void TextEditorView::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void TextEditorView::contextHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
AbstractView::contextHelpId(callback);
|
||||
}
|
||||
|
||||
void TextEditorView::qmlJSEditorHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void TextEditorView::qmlJSEditorHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
if (m_widget->textEditor())
|
||||
m_widget->textEditor()->contextHelp(callback);
|
||||
|
@@ -69,9 +69,9 @@ public:
|
||||
|
||||
// TextEditorView
|
||||
WidgetInfo widgetInfo() override;
|
||||
void contextHelpId(const Core::IContext::HelpIdCallback &callback) const override;
|
||||
void contextHelpId(const Core::IContext::HelpCallback &callback) const override;
|
||||
|
||||
void qmlJSEditorHelpId(const Core::IContext::HelpIdCallback &callback) const;
|
||||
void qmlJSEditorHelpId(const Core::IContext::HelpCallback &callback) const;
|
||||
|
||||
TextEditor::BaseTextEditor *textEditor();
|
||||
|
||||
|
@@ -94,7 +94,7 @@ void TextEditorWidget::setTextEditor(TextEditor::BaseTextEditor *textEditor)
|
||||
oldEditor->deleteLater();
|
||||
}
|
||||
|
||||
void TextEditorWidget::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void TextEditorWidget::contextHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
m_textEditorView->contextHelpId(callback);
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
return m_textEditor.get();
|
||||
}
|
||||
|
||||
void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
|
||||
void contextHelpId(const Core::IContext::HelpCallback &callback) const;
|
||||
void jumpTextCursorToSelectedModelNode();
|
||||
void gotoCursorPosition(int line, int column);
|
||||
|
||||
|
@@ -257,7 +257,7 @@ public:
|
||||
virtual void disableWidget();
|
||||
virtual void enableWidget();
|
||||
|
||||
virtual void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
|
||||
virtual void contextHelpId(const Core::IContext::HelpCallback &callback) const;
|
||||
|
||||
void activateTimeline(const ModelNode &timeline);
|
||||
void activateTimelineRecording(const ModelNode &timeline);
|
||||
|
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
void toggleStatesViewExpanded();
|
||||
|
||||
void qmlJSEditorHelpId(const Core::IContext::HelpIdCallback &callback) const;
|
||||
void qmlJSEditorHelpId(const Core::IContext::HelpCallback &callback) const;
|
||||
DesignDocument *currentDesignDocument() const;
|
||||
|
||||
bool usesRewriterView(RewriterView *rewriterView);
|
||||
|
@@ -577,7 +577,7 @@ void AbstractView::enableWidget()
|
||||
widgetInfo().widget->setEnabled(true);
|
||||
}
|
||||
|
||||
void AbstractView::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void AbstractView::contextHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
#ifndef QMLDESIGNER_TEST
|
||||
QmlDesignerPlugin::instance()->viewManager().qmlJSEditorHelpId(callback);
|
||||
|
@@ -424,7 +424,7 @@ void ViewManager::toggleStatesViewExpanded()
|
||||
d->statesEditorView.toggleStatesViewExpanded();
|
||||
}
|
||||
|
||||
void ViewManager::qmlJSEditorHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void ViewManager::qmlJSEditorHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
d->textEditorView.qmlJSEditorHelpId(callback);
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ DesignModeContext::DesignModeContext(QWidget *widget)
|
||||
setContext(Core::Context(Constants::C_QMLDESIGNER, Constants::C_QT_QUICK_TOOLS_MENU));
|
||||
}
|
||||
|
||||
void DesignModeContext::contextHelp(const HelpIdCallback &callback) const
|
||||
void DesignModeContext::contextHelp(const HelpCallback &callback) const
|
||||
{
|
||||
qobject_cast<DesignModeWidget *>(m_widget)->contextHelpId(callback);
|
||||
}
|
||||
@@ -52,7 +52,7 @@ FormEditorContext::FormEditorContext(QWidget *widget)
|
||||
setContext(Core::Context(Constants::C_QMLFORMEDITOR, Constants::C_QT_QUICK_TOOLS_MENU));
|
||||
}
|
||||
|
||||
void FormEditorContext::contextHelp(const HelpIdCallback &callback) const
|
||||
void FormEditorContext::contextHelp(const HelpCallback &callback) const
|
||||
{
|
||||
qobject_cast<FormEditorWidget *>(m_widget)->contextHelpId(callback);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ NavigatorContext::NavigatorContext(QWidget *widget)
|
||||
setContext(Core::Context(Constants::C_QMLNAVIGATOR, Constants::C_QT_QUICK_TOOLS_MENU));
|
||||
}
|
||||
|
||||
void NavigatorContext::contextHelp(const HelpIdCallback &callback) const
|
||||
void NavigatorContext::contextHelp(const HelpCallback &callback) const
|
||||
{
|
||||
qobject_cast<NavigatorWidget *>(m_widget)->contextHelpId(callback);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ TextEditorContext::TextEditorContext(QWidget *widget)
|
||||
setContext(Core::Context(Constants::C_QMLTEXTEDITOR, Constants::C_QT_QUICK_TOOLS_MENU));
|
||||
}
|
||||
|
||||
void TextEditorContext::contextHelp(const HelpIdCallback &callback) const
|
||||
void TextEditorContext::contextHelp(const HelpCallback &callback) const
|
||||
{
|
||||
qobject_cast<TextEditorWidget *>(m_widget)->contextHelpId(callback);
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ class DesignModeContext : public Core::IContext
|
||||
|
||||
public:
|
||||
DesignModeContext(QWidget *widget);
|
||||
void contextHelp(const Core::IContext::HelpIdCallback &callback) const override;
|
||||
void contextHelp(const Core::IContext::HelpCallback &callback) const override;
|
||||
};
|
||||
|
||||
class FormEditorContext : public Core::IContext
|
||||
@@ -48,7 +48,7 @@ class FormEditorContext : public Core::IContext
|
||||
|
||||
public:
|
||||
FormEditorContext(QWidget *widget);
|
||||
void contextHelp(const Core::IContext::HelpIdCallback &callback) const override;
|
||||
void contextHelp(const Core::IContext::HelpCallback &callback) const override;
|
||||
};
|
||||
|
||||
class NavigatorContext : public Core::IContext
|
||||
@@ -57,7 +57,7 @@ class NavigatorContext : public Core::IContext
|
||||
|
||||
public:
|
||||
NavigatorContext(QWidget *widget);
|
||||
void contextHelp(const Core::IContext::HelpIdCallback &callback) const override;
|
||||
void contextHelp(const Core::IContext::HelpCallback &callback) const override;
|
||||
};
|
||||
|
||||
class TextEditorContext : public Core::IContext
|
||||
@@ -66,7 +66,7 @@ class TextEditorContext : public Core::IContext
|
||||
|
||||
public:
|
||||
TextEditorContext(QWidget *widget);
|
||||
void contextHelp(const Core::IContext::HelpIdCallback &callback) const override;
|
||||
void contextHelp(const Core::IContext::HelpCallback &callback) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -554,7 +554,7 @@ void DesignModeWidget::showInternalTextEditor()
|
||||
m_centralTabWidget->switchTo(viewManager().widget("TextEditor"));
|
||||
}
|
||||
|
||||
void DesignModeWidget::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
|
||||
void DesignModeWidget::contextHelpId(const Core::IContext::HelpCallback &callback) const
|
||||
{
|
||||
if (currentDesignDocument())
|
||||
currentDesignDocument()->contextHelpId(callback);
|
||||
|
@@ -61,7 +61,7 @@ public:
|
||||
DesignModeWidget();
|
||||
~DesignModeWidget() override;
|
||||
|
||||
void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
|
||||
void contextHelpId(const Core::IContext::HelpCallback &callback) const;
|
||||
|
||||
void initialize();
|
||||
|
||||
|
@@ -71,7 +71,7 @@ void BaseHoverHandler::setPriority(int priority)
|
||||
|
||||
void BaseHoverHandler::contextHelpId(TextEditorWidget *widget,
|
||||
int pos,
|
||||
const Core::IContext::HelpIdCallback &callback)
|
||||
const Core::IContext::HelpCallback &callback)
|
||||
{
|
||||
m_isContextHelpRequest = true;
|
||||
|
||||
@@ -115,7 +115,7 @@ bool BaseHoverHandler::isContextHelpRequest() const
|
||||
}
|
||||
|
||||
void BaseHoverHandler::propagateHelpId(TextEditorWidget *widget,
|
||||
const Core::IContext::HelpIdCallback &callback)
|
||||
const Core::IContext::HelpCallback &callback)
|
||||
{
|
||||
const Core::HelpItem contextHelp = lastHelpItemIdentified();
|
||||
widget->setContextHelpItem(contextHelp);
|
||||
|
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
void contextHelpId(TextEditorWidget *widget,
|
||||
int pos,
|
||||
const Core::IContext::HelpIdCallback &callback);
|
||||
const Core::IContext::HelpCallback &callback);
|
||||
|
||||
using ReportPriority = std::function<void(int priority)>;
|
||||
void checkPriority(TextEditorWidget *widget, int pos, ReportPriority report);
|
||||
@@ -73,7 +73,7 @@ protected:
|
||||
|
||||
bool isContextHelpRequest() const;
|
||||
|
||||
void propagateHelpId(TextEditorWidget *widget, const Core::IContext::HelpIdCallback &callback);
|
||||
void propagateHelpId(TextEditorWidget *widget, const Core::IContext::HelpCallback &callback);
|
||||
|
||||
// identifyMatch() is required to report a priority by using the "report" callback.
|
||||
// It is recommended to use e.g.
|
||||
|
@@ -8005,7 +8005,7 @@ void TextEditorWidgetPrivate::updateCursorPosition()
|
||||
q->ensureCursorVisible();
|
||||
}
|
||||
|
||||
void BaseTextEditor::contextHelp(const HelpIdCallback &callback) const
|
||||
void BaseTextEditor::contextHelp(const HelpCallback &callback) const
|
||||
{
|
||||
editorWidget()->contextHelpItem(callback);
|
||||
}
|
||||
@@ -8016,7 +8016,7 @@ void BaseTextEditor::setContextHelp(const HelpItem &item)
|
||||
editorWidget()->setContextHelpItem(item);
|
||||
}
|
||||
|
||||
void TextEditorWidget::contextHelpItem(const IContext::HelpIdCallback &callback)
|
||||
void TextEditorWidget::contextHelpItem(const IContext::HelpCallback &callback)
|
||||
{
|
||||
if (!d->m_contextHelpItem.isValid() && !d->m_hoverHandlers.isEmpty()) {
|
||||
d->m_hoverHandlers.first()->contextHelpId(this,
|
||||
|
@@ -131,7 +131,7 @@ public:
|
||||
bool restoreState(const QByteArray &state) override;
|
||||
QWidget *toolBar() override;
|
||||
|
||||
void contextHelp(const HelpIdCallback &callback) const override; // from IContext
|
||||
void contextHelp(const HelpCallback &callback) const override; // from IContext
|
||||
void setContextHelp(const Core::HelpItem &item) override;
|
||||
|
||||
int currentLine() const override;
|
||||
@@ -543,7 +543,7 @@ public:
|
||||
QChar characterAt(int pos) const;
|
||||
QString textAt(int from, int to) const;
|
||||
|
||||
void contextHelpItem(const Core::IContext::HelpIdCallback &callback);
|
||||
void contextHelpItem(const Core::IContext::HelpCallback &callback);
|
||||
void setContextHelpItem(const Core::HelpItem &item);
|
||||
|
||||
static TextEditorWidget *currentTextEditorWidget();
|
||||
|
Reference in New Issue
Block a user