dde-dock/widgets/tipswidget.h
Fan PengCheng 8ad3d835ed fix: 修复藏语环境下字体显示不全的问题
藏语字体环境下,计算得到字体高度会出现,换用QFontMetrics的boundingRect函数获取其高度即可

Log: 修复藏语环境下字体显示不全的问题
Bug: https://pms.uniontech.com/zentao/bug-view-79014.html
Bug: https://pms.uniontech.com/zentao/bug-view-78763.html
Change-Id: I6388b74b1d2930c98d3b4dfb5db496505234c954
2021-05-12 17:33:19 +08:00

34 lines
656 B
C++

#ifndef TIPSWIDGET_H
#define TIPSWIDGET_H
#include <QFrame>
namespace Dock {
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;
ShowType m_type;
};
}
#endif // TIPSWIDGET_H