2023-02-16 13:51:55 +08:00
|
|
|
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
2022-09-06 11:36:55 +08:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2018-07-02 16:21:43 +08:00
|
|
|
#ifndef TIPSWIDGET_H
|
|
|
|
#define TIPSWIDGET_H
|
|
|
|
|
|
|
|
#include <QFrame>
|
2020-06-29 15:35:51 +08:00
|
|
|
namespace Dock {
|
2018-07-02 16:21:43 +08:00
|
|
|
class TipsWidget : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-05-07 16:28:16 +08:00
|
|
|
enum ShowType
|
|
|
|
{
|
|
|
|
SingleLine,
|
|
|
|
MultiLine
|
|
|
|
};
|
2018-07-02 16:21:43 +08:00
|
|
|
public:
|
|
|
|
explicit TipsWidget(QWidget *parent = nullptr);
|
|
|
|
|
2020-03-13 12:59:02 +08:00
|
|
|
const QString& text(){return m_text;}
|
2020-05-06 18:44:11 +08:00
|
|
|
const QStringList &textList() { return m_textList; }
|
2018-07-02 16:21:43 +08:00
|
|
|
void setText(const QString &text);
|
2020-05-06 18:44:11 +08:00
|
|
|
void setTextList(const QStringList &textList);
|
2021-05-12 17:32:04 +08:00
|
|
|
|
2018-07-02 16:21:43 +08:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
2020-06-24 15:51:53 +08:00
|
|
|
bool event(QEvent *event) override;
|
2018-07-02 16:21:43 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_text;
|
2020-05-06 18:44:11 +08:00
|
|
|
QStringList m_textList;
|
2020-05-07 16:28:16 +08:00
|
|
|
ShowType m_type;
|
2018-07-02 16:21:43 +08:00
|
|
|
};
|
2020-06-29 15:35:51 +08:00
|
|
|
}
|
2018-07-02 16:21:43 +08:00
|
|
|
|
|
|
|
#endif // TIPSWIDGET_H
|