swift
Loading...
Searching...
No Matches
validationindicator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_GUI_EDITOR_VALIDATIONINDICATOR_H
7#define SWIFT_GUI_EDITOR_VALIDATIONINDICATOR_H
8
9#include <QFrame>
10#include <QObject>
11#include <QScopedPointer>
12#include <QString>
13#include <QTimer>
14
15#include "gui/swiftguiexport.h"
17
18class QPaintEvent;
19class QWidget;
20
21namespace Ui
22{
23 class CValidationIndicator;
24}
25
26namespace swift::gui::editors
27{
32 {
34
35 public:
37 explicit CValidationIndicator(QWidget *parent = nullptr);
38
41
43 void passed();
44
46 void warnings();
47
49 void failed();
50
52 void setState(bool ok);
53
56
57 public slots:
59 void clear();
60
61 protected:
63 void paintEvent(QPaintEvent *paintEvent) override;
64
65 private:
66 const int ResetInterval = 5000;
68
70 void setBackgroundColor(const QString &colorName);
71
72 QTimer m_resetTimer;
73 QString m_originalStyleSheet;
74 };
75} // namespace swift::gui::editors
76
77#endif // SWIFT_GUI_EDITOR_VALIDATIONINDICATOR_H
void setState(bool ok)
Ok or failed validation?
CValidationIndicator(QWidget *parent=nullptr)
Constructor.
Status messages, e.g. from Core -> GUI.
QFrame(QWidget *parent, Qt::WindowFlags f)
Q_OBJECTQ_OBJECT
QObject * parent() const const
QWidget(QWidget *parent, Qt::WindowFlags f)
#define SWIFT_GUI_EXPORT
Export a class or function from the library.