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

QStaticText copy constructor does not copy the textOption property

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 4.7.0
    • Fix Version/s: 4.7.0
    • Component/s: GUI: Text handling
    • Labels:
      None
    • Environment:
      MeeGo
    • Commits:
      200d1743dcdacf1036384f746046e55d91ccd918

      Description

      When using the copy constructor of QStaticText, the property textOption won't be copied. To reproduce:

      QTextOption textOption(Qt::AlignRight);
      QStaticText staticText1;
      staticText1.setTextOption(textOption);

      QStaticText staticText2(staticText1);
      if (staticText1.textOption().alignment() != staticText2.textOption().alignment()) {
      qWarning() << "text option not copied";
      }

      Replacing the line 397 from qstatictext.cpp:
      items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0), needsRelayout(true),
      by
      items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0), textOption(other.textOption), needsRelayout(true),
      should fix this.

        Attachments

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

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            ppenz Peter Penz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes