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

QStaticText copy constructor does not copy the textOption property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.0
    • 4.7.0
    • GUI: Text handling
    • None
    • MeeGo
    • 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

            esabraha Eskil Abrahamsen Blomfeldt
            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