blob: d0bab01e09863291c9aac922c03652937c17d608 (
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
|
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "utils_global.h"
#include "detailswidget.h"
#include "result.h"
#include "infolabel.h"
#include <QWidget>
namespace Utils {
class QTCREATOR_UTILS_EXPORT SummaryWidget : public QWidget
{
public:
SummaryWidget(const QMap<int, QString> &validationPoints, const QString &validText,
const QString &invalidText, DetailsWidget *detailsWidget);
template<class T>
void setPointValid(int key, const Result<T> &test)
{
setPointValid(key, test.has_value(), test.has_value() ? QString{} : test.error());
}
void setPointValid(int key, bool valid, const QString errorText = {});
bool rowsOk(const QList<int> &keys) const;
bool allRowsOk() const;
void setInfoText(const QString &text);
void setInProgressText(const QString &text);
void setSetupOk(bool ok);
private:
void updateUi();
class RowData {
public:
InfoLabel *m_infoLabel = nullptr;
bool m_valid = false;
QString m_validText;
};
QString m_validText;
QString m_invalidText;
QString m_infoText;
DetailsWidget *m_detailsWidget = nullptr;
QMap<int, RowData> m_validationData;
};
} // namespace Utils
|