forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Orgad Shaneh
parent
6cd68d5401
commit
2c6adc1e74
@@ -28,7 +28,7 @@
|
||||
#include "vcsbase_global.h"
|
||||
|
||||
#include <QVariant>
|
||||
#include <QWidget>
|
||||
#include <QToolBar>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QComboBox;
|
||||
@@ -38,15 +38,17 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace VcsBase {
|
||||
|
||||
class VcsBaseEditorWidget;
|
||||
|
||||
namespace Internal { class VcsBaseEditorParameterWidgetPrivate; }
|
||||
|
||||
// Documentation->inside.
|
||||
class VCSBASE_EXPORT VcsBaseEditorParameterWidget : public QWidget
|
||||
class VCSBASE_EXPORT VcsBaseEditorParameterWidget : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit VcsBaseEditorParameterWidget(QWidget *parent = 0);
|
||||
explicit VcsBaseEditorParameterWidget(QToolBar *toolBar);
|
||||
~VcsBaseEditorParameterWidget() override;
|
||||
|
||||
class VCSBASE_EXPORT ComboBoxItem
|
||||
@@ -61,13 +63,13 @@ public:
|
||||
QStringList baseArguments() const;
|
||||
void setBaseArguments(const QStringList &);
|
||||
|
||||
QToolButton *addToggleButton(const QString &option, const QString &label,
|
||||
const QString &tooltip = QString());
|
||||
QToolButton *addToggleButton(const QStringList &options, const QString &label,
|
||||
const QString &tooltip = QString());
|
||||
QAction *addToggleButton(const QString &option, const QString &label,
|
||||
const QString &tooltip = QString());
|
||||
QAction *addToggleButton(const QStringList &options, const QString &label,
|
||||
const QString &tooltip = QString());
|
||||
QComboBox *addComboBox(const QStringList &options, const QList<ComboBoxItem> &items);
|
||||
|
||||
void mapSetting(QToolButton *button, bool *setting);
|
||||
void mapSetting(QAction *button, bool *setting);
|
||||
void mapSetting(QComboBox *comboBox, QString *setting);
|
||||
void mapSetting(QComboBox *comboBox, int *setting);
|
||||
|
||||
@@ -89,10 +91,10 @@ protected:
|
||||
{
|
||||
public:
|
||||
OptionMapping() = default;
|
||||
OptionMapping(const QString &option, QWidget *w);
|
||||
OptionMapping(const QStringList &optionList, QWidget *w);
|
||||
OptionMapping(const QString &option, QObject *obj);
|
||||
OptionMapping(const QStringList &optionList, QObject *obj);
|
||||
QStringList options;
|
||||
QWidget *widget = nullptr;
|
||||
QObject *object = nullptr;
|
||||
};
|
||||
|
||||
const QList<OptionMapping> &optionMappings() const;
|
||||
|
||||
Reference in New Issue
Block a user