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

Text { style: Text.outline; clip: true } clips the outline at the edges

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • 5.15.7, 6.2.1
    • None

      QRectF QQuickText::clipRect() const
      {
          Q_D(const QQuickText);
      
          QRectF rect = QQuickImplicitSizeItem::clipRect();
          if (d->style != Normal)
              rect.adjust(-1, 0, 1, 2);
          return rect;
      }
      

      That looks suspicious, and is not enough in practice: the outline can be wider than 1 pixel, depending on the last character in the string. Either we should make it avoid clipping the outline in every case, or else take out this adjustment and add a documentation warning that if you use clipping and text style together, the result will not look good. That would simplify the code: we could avoid overriding clipRect() at all, and therefore would not need to add documentation explaining how and why it makes it larger.

      On the other hand, maybe this issue doesn't happen much in practice, whereas removing the adjustment might make it happen more easily, and some users would see it as a regression.

        1. text-outline-clip.png
          315 kB
          Shawn Rutledge
        2. text-outline-clip.qml
          0.6 kB
          Shawn Rutledge
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes