blob: 35ebd9aa5584534adb7f16ba76f628017dcffffb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 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
|