Files
qt-creator/src/plugins/vcsbase/submitfieldwidget.h
hjk 6ff6fe3b0e VcsBase: Remove Q_PROPERTY definitions
The initial intention was to make these widgets usable from Designer.

We don't expect a lot of new uses in this direction, and clazy
seems to warn about not-so-complete Q_PROPERTY definitions:

Link https://github.com/KDE/clazy/blob/master/docs/checks/README-qproperty-without-notify.md

Change-Id: I4a2e9ff6ec7ecfd989196801c789533b4c44e8af
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 06:00:31 +00:00

59 lines
1.3 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include "vcsbase_global.h"
#include <QWidget>
QT_BEGIN_NAMESPACE
class QCompleter;
QT_END_NAMESPACE
namespace VcsBase {
struct SubmitFieldWidgetPrivate;
class VCSBASE_EXPORT SubmitFieldWidget : public QWidget
{
Q_OBJECT
public:
explicit SubmitFieldWidget(QWidget *parent = nullptr);
~SubmitFieldWidget() override;
QStringList fields() const;
void setFields(const QStringList&);
bool hasBrowseButton() const;
void setHasBrowseButton(bool d);
// Allow several entries for fields ("reviewed-by: a", "reviewed-by: b")
bool allowDuplicateFields() const;
void setAllowDuplicateFields(bool);
QCompleter *completer() const;
void setCompleter(QCompleter *c);
QString fieldValue(int pos) const;
void setFieldValue(int pos, const QString &value);
QString fieldValues() const;
signals:
void browseButtonClicked(int pos, const QString &field);
private:
void slotRemove(int pos);
void slotComboIndexChanged(int pos, int comboIndex);
void removeField(int index);
bool comboIndexChange(int fieldNumber, int index);
void createField(const QString &f);
SubmitFieldWidgetPrivate *d;
};
} // namespace VcsBase