Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2, 6.2.3, 6.7
-
None
Description
see attached example:
reproduce steps:
1, run the application
2,drag one docker overlap the other docker
3. the ... will not disappear even if drag the docker's width to much larger.
seems only occur when the docker window's title is Chinese.
/edit: Christian Ehrlicher
After investigation it looks like it's a problem within QFontMetrics::size() or elidedText() when there is more than one writing system is involved:
int main(int argc, char *argv[]) { QApplication a(argc, argv); const QString str1 = QString::fromUtf8("收藏面板测试用(&A)"); const QString str2 = QString::fromUtf8("收藏面板测试用(&用))"); QFontMetrics fm(a.font()); QTextOption opt; auto size1 = fm.size(Qt::TextShowMnemonic, str1); auto size2 = fm.size(Qt::TextShowMnemonic, str2); const QString strOut1 = fm.elidedText(str1, Qt::ElideRight, size1.width(), Qt::TextShowMnemonic); const QString strOut2 = fm.elidedText(str2, Qt::ElideRight, size2.width(), Qt::TextShowMnemonic); qDebug() << size1 << size2 << strOut1 << strOut2; return 0; }
str1 is elided whereas str2 is not.