Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-101974

qdockerwidget title's elide dots will not disappear no matter how large the width is

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2, 6.2.3, 6.7
    • GUI: Text handling
    • None
    • All

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            xiaoyifang yifang xiao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes