Editor: enable optional actions per editor

Use an additional action mask to enable actions like find usage and
rename symbol per editor instance.

Change-Id: Iabee1820d0f3c156ad30ba760bfce9f6181045e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-06-15 12:40:08 +02:00
parent bdc8411af5
commit 5f91985931
3 changed files with 27 additions and 7 deletions

View File

@@ -628,6 +628,7 @@ public:
QComboBox *m_fileLineEnding = nullptr;
QAction *m_fileLineEndingAction = nullptr;
uint m_optionalActionMask = TextEditorActionHandler::None;
bool m_contentsChanged = false;
bool m_lastCursorChangeWasInteresting = false;
@@ -7827,6 +7828,16 @@ void TextEditorWidget::appendStandardContextMenuActions(QMenu *menu)
}
}
uint TextEditorWidget::optionalActionMask()
{
return d->m_optionalActionMask;
}
void TextEditorWidget::addOptionalActions(uint optionalActionMask)
{
d->m_optionalActionMask |= optionalActionMask;
emit optionalActionMaskChanged();
}
BaseTextEditor::BaseTextEditor()
: d(new BaseTextEditorPrivate)