mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00

字体大小变换后,需要同步更新布局 Log: 增加字体大小变换后,同步布局 Bug: https://pms.uniontech.com/zentao/bug-view-35000.html
34 lines
659 B
C++
34 lines
659 B
C++
#ifndef TIPSWIDGET_H
|
|
#define TIPSWIDGET_H
|
|
|
|
#include <QFrame>
|
|
|
|
class TipsWidget : public QFrame
|
|
{
|
|
Q_OBJECT
|
|
enum ShowType
|
|
{
|
|
SingleLine,
|
|
MultiLine
|
|
};
|
|
public:
|
|
explicit TipsWidget(QWidget *parent = nullptr);
|
|
|
|
const QString& text(){return m_text;}
|
|
const QStringList &textList() { return m_textList; }
|
|
void setText(const QString &text);
|
|
void setTextList(const QStringList &textList);
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
bool event(QEvent *event) override;
|
|
|
|
private:
|
|
QString m_text;
|
|
QStringList m_textList;
|
|
int m_width;
|
|
ShowType m_type;
|
|
};
|
|
|
|
#endif // TIPSWIDGET_H
|