mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00

藏语字体环境下,计算得到字体高度会出现,换用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
34 lines
656 B
C++
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
|