diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2015-08-24 13:39:40 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2016-10-24 16:23:33 +0000 |
commit | 2c6adc1e747575af5198cc7ea2277b9a70366d3c (patch) | |
tree | 67cb25bd5fa7ff603fa1daf10bf29a7c4af01b9c /src/plugins/perforce | |
parent | 6cd68d5401d05187ec3c1eef4e2b9d7846fbfa75 (diff) |
VCS: Replace QToolButtons in VCS toolbar with QActions
Change VcsBaseEditorParameterWidget to add actions/widgets to an
existing toolbar, instead of being a widget itself.
The class is renamed in a follow-up commit.
Task-number: QTCREATORBUG-14934
Change-Id: I473a439d12a096f4cbb64f06faa0598ee72000de
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/plugins/perforce')
-rw-r--r-- | src/plugins/perforce/perforceplugin.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index a351014293d..76aa840581e 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1199,7 +1199,7 @@ class PerforceDiffParameterWidget : public VcsBaseEditorParameterWidget { Q_OBJECT public: - explicit PerforceDiffParameterWidget(const PerforceDiffParameters &p, QWidget *parent = 0); + explicit PerforceDiffParameterWidget(const PerforceDiffParameters &p, QToolBar *toolBar); void triggerReRun(); signals: @@ -1209,8 +1209,9 @@ private: const PerforceDiffParameters m_parameters; }; -PerforceDiffParameterWidget::PerforceDiffParameterWidget(const PerforceDiffParameters &p, QWidget *parent) : - VcsBaseEditorParameterWidget(parent), m_parameters(p) +PerforceDiffParameterWidget::PerforceDiffParameterWidget(const PerforceDiffParameters &p, + QToolBar *toolBar) : + VcsBaseEditorParameterWidget(toolBar), m_parameters(p) { setBaseArguments(p.diffArguments); addToggleButton(QLatin1String("w"), tr("Ignore Whitespace")); @@ -1269,12 +1270,12 @@ void PerforcePlugin::p4Diff(const PerforceDiffParameters &p) auto diffEditorWidget = qobject_cast<VcsBaseEditorWidget *>(editor->widget()); // Wire up the parameter widget to trigger a re-run on // parameter change and 'revert' from inside the diff editor. - auto pw = new PerforceDiffParameterWidget(p); + auto pw = new PerforceDiffParameterWidget(p, diffEditorWidget->toolBar()); connect(pw, &PerforceDiffParameterWidget::reRunDiff, this, [this](const PerforceDiffParameters &p) { p4Diff(p); }); connect(diffEditorWidget, &VcsBaseEditorWidget::diffChunkReverted, pw, &PerforceDiffParameterWidget::triggerReRun); - diffEditorWidget->setConfigurationWidget(pw); + diffEditorWidget->setConfigurationAdded(); } void PerforcePlugin::describe(const QString & source, const QString &n) |