2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2019 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2019-12-11 15:55:03 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "utils_global.h"
|
|
|
|
|
|
|
|
|
|
#include "elidinglabel.h"
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
|
|
|
|
|
|
|
|
|
class QTCREATOR_UTILS_EXPORT InfoLabel : public ElidingLabel
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
enum InfoType {
|
|
|
|
|
Information,
|
|
|
|
|
Warning,
|
|
|
|
|
Error,
|
|
|
|
|
Ok,
|
|
|
|
|
NotOk,
|
|
|
|
|
None
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
explicit InfoLabel(QWidget *parent);
|
|
|
|
|
explicit InfoLabel(const QString &text = {}, InfoType type = Information,
|
|
|
|
|
QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
|
|
InfoType type() const;
|
|
|
|
|
void setType(InfoType type);
|
|
|
|
|
bool filled() const;
|
|
|
|
|
void setFilled(bool filled);
|
2019-12-21 22:58:24 +01:00
|
|
|
QSize minimumSizeHint() const override;
|
2019-12-11 15:55:03 +01:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
InfoType m_type = Information;
|
|
|
|
|
bool m_filled = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Utils
|