diff options
author | hjk <hjk@qt.io> | 2020-02-05 11:45:49 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-02-05 11:09:39 +0000 |
commit | ccc2a347a75c3fd06d8f2028a17a3477c40e0a13 (patch) | |
tree | 7bcba50dacb7a87fa296bed51020eae6f6308cdb /src/plugins/vcsbase | |
parent | 183048b58754bacf98088c7a6d5564777eef4be9 (diff) |
Vcs: Drop QActionSetTextSlotHelper
With the possibility to connect to any function that's not needed
anymore.
Change-Id: I307f706aa922a3b7d9f1cd7e2e88cece71090946
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r-- | src/plugins/vcsbase/submiteditorwidget.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/plugins/vcsbase/submiteditorwidget.cpp b/src/plugins/vcsbase/submiteditorwidget.cpp index e1e69d21e1..e87a317719 100644 --- a/src/plugins/vcsbase/submiteditorwidget.cpp +++ b/src/plugins/vcsbase/submiteditorwidget.cpp @@ -104,20 +104,6 @@ void QActionPushButton::actionChanged() } } -// A helper parented on a QAction, -// making QAction::setText() a slot (which it currently is not). -class QActionSetTextSlotHelper : public QObject -{ - Q_OBJECT -public: - explicit QActionSetTextSlotHelper(QAction *a) : QObject(a) {} - -public slots: - void setText(const QString &t) { - if (auto action = qobject_cast<QAction *>(parent())) - action->setText(t); - } -}; // Helpers to retrieve model data // Convenience to extract a list of selected indexes @@ -206,12 +192,8 @@ void SubmitEditorWidget::registerActions(QAction *editorUndoAction, QAction *edi d->m_commitEnabled = !canSubmit(); connect(this, &SubmitEditorWidget::submitActionEnabledChanged, submitAction, &QAction::setEnabled); - // Wire setText via QActionSetTextSlotHelper. - auto actionSlotHelper = submitAction->findChild<QActionSetTextSlotHelper *>(); - if (!actionSlotHelper) - actionSlotHelper = new QActionSetTextSlotHelper(submitAction); connect(this, &SubmitEditorWidget::submitActionTextChanged, - actionSlotHelper, &QActionSetTextSlotHelper::setText); + submitAction, &QAction::setText); d->m_submitButton = new QActionPushButton(submitAction); d->m_ui.buttonLayout->addWidget(d->m_submitButton); if (!d->m_submitShortcut) |