forked from qt-creator/qt-creator
TextEditor: Give access to m_toolBarWidget
The TextEditor doesn't export its actual toolbar via IEditor::toolBar(), but an internal container widget. This forces other editors that want to reuse TextEditorWidget to poke into internal details of TextEditorWidget if they want to provide the full toolbar including line number button. By giving access to m_toolBarWidget, other editors like the Markdown editor can show the full toolbar including line numbers without risking to break, if TextEditorWidget should refactor its toolbar container. Task-number: QTCREATORBUG-30166 Change-Id: Ic54f21be1897f00801c6a3cfe29c89131d61e3a5 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -8762,7 +8762,7 @@ IDocument *BaseTextEditor::document() const
|
||||
|
||||
QWidget *BaseTextEditor::toolBar()
|
||||
{
|
||||
return editorWidget()->d->m_toolBarWidget;
|
||||
return editorWidget()->toolBarWidget();
|
||||
}
|
||||
|
||||
QAction * TextEditorWidget::insertExtraToolBarWidget(TextEditorWidget::Side side,
|
||||
@@ -8923,7 +8923,12 @@ void TextEditorWidget::setCursorPosition(int pos)
|
||||
setTextCursor(tc);
|
||||
}
|
||||
|
||||
QToolBar *TextEditorWidget::toolBar()
|
||||
QWidget *TextEditorWidget::toolBarWidget() const
|
||||
{
|
||||
return d->m_toolBarWidget;
|
||||
}
|
||||
|
||||
QToolBar *TextEditorWidget::toolBar() const
|
||||
{
|
||||
return d->m_toolBar;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user