mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
refs #452 editors
the editors allow to enter data for the different value objects
This commit is contained in:
committed by
Mathew Sutcliffe
parent
93e6e1d38e
commit
513eb07a13
77
src/blackgui/editors/validationindicator.h
Normal file
77
src/blackgui/editors/validationindicator.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* Copyright (C) 2015
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_EDITOR_VALIDATIONINDICATOR_H
|
||||
#define BLACKGUI_EDITOR_VALIDATIONINDICATOR_H
|
||||
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
#include <QTimer>
|
||||
|
||||
namespace Ui { class CValidationIndicator; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Editors
|
||||
{
|
||||
/*!
|
||||
* Indication state of validation
|
||||
*/
|
||||
class CValidationIndicator : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CValidationIndicator(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CValidationIndicator();
|
||||
|
||||
//! Validation passed
|
||||
void passed();
|
||||
|
||||
//! Passed with warnings
|
||||
void warnings();
|
||||
|
||||
//! Validation failed
|
||||
void failed();
|
||||
|
||||
//! Ok or failed validation?
|
||||
void setState(bool ok);
|
||||
|
||||
//! Messages from status messages
|
||||
void setState(const BlackMisc::CStatusMessageList &msgs);
|
||||
|
||||
public slots:
|
||||
//! Cleared state
|
||||
void clear();
|
||||
|
||||
protected:
|
||||
//! \copydoc QFrame::paintEvent
|
||||
virtual void paintEvent(QPaintEvent *paintEvent) override;
|
||||
|
||||
private:
|
||||
const int ResetInterval = 5000;
|
||||
QScopedPointer<Ui::CValidationIndicator> ui;
|
||||
|
||||
//! Set background color
|
||||
void setBackgroundColor(const QString colorName);
|
||||
|
||||
QTimer m_resetTimer { this}; //!< reset to neutral
|
||||
QString m_originalStyleSheet; //!< stored, to be able to reset
|
||||
};
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user