From deeb523fea3c031b42a64518c04d9f25df5f428b Mon Sep 17 00:00:00 2001 From: qiuchangxing Date: Tue, 27 Apr 2021 19:18:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=97=8F=E8=AF=AD=EF=BC=8C=E4=BB=BB=E5=8A=A1=E6=A0=8F=E4=B8=AD?= =?UTF-8?q?tooltip=E7=9A=84=E5=BA=94=E7=94=A8=E5=90=8D=E7=A7=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8=EF=BC=8C=E8=97=8F=E8=AF=AD=E5=A4=B4?= =?UTF-8?q?=E9=83=A8=E8=A2=AB=E6=88=AA=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tooltip的应用名称显示绘制时,字体所占像素调整为字体实际使用rect高度的一半减一最为合适,否则碰到藏文这种特殊字体会导致显示不全 Log: 修复切换藏语,任务栏中tooltip的应用名称显示异常,藏语头部被截断 Bug: https://pms.uniontech.com/zentao/bug-view-76847.html Change-Id: Ia999ef70acb93bdf9b6d7039c9facac5b21e9250 --- widgets/tipswidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widgets/tipswidget.cpp b/widgets/tipswidget.cpp index 16b5fb46f..569c2576b 100644 --- a/widgets/tipswidget.cpp +++ b/widgets/tipswidget.cpp @@ -61,6 +61,10 @@ void TipsWidget::paintEvent(QPaintEvent *event) int fontHeight = fontMetrics().height(); option.setAlignment(Qt::AlignCenter); + QFont textFont; + textFont.setPixelSize(rect().height() / 2 - 1); + painter.setFont(textFont); + switch (m_type) { case SingleLine: { painter.drawText(rect(), m_text, option);