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

QML TextEdit vertical alignment not updated when rect height changes

XMLWordPrintable

    • 4.8.6: 292a6707e565f226314fba541b3cdeaef5046d4e 5.3: 2cd0b96a269efa96f1f2759980ea207b94a995e2

      TextEdit text vertical alignment position is not updated correctly when TextEdit height is changed. Position is updated only when width is changed. with plain "Text"-item both works. Please see test and see both in attached main.qml. (left click to change height, right changes width)

      Tested also that "TextInput"-item works fine. Issue is only with "TextEdit"-item. Maybe there's something missing that "Text" and "TextInput" has.

      All above is valid when using Qt Quick 2.

      Here is one solution worked for Qt Quick 1:

      qtquick1srcdeclarativegraphicsitemsqdeclarativetextEdit.cpp
      void QDeclarativeTextEdit::geometryChanged(const QRectF &newGeometry,
                                        const QRectF &oldGeometry)
      {
      //    if (newGeometry.width() != oldGeometry.width())
          if (newGeometry != oldGeometry)
              updateSize();
          QDeclarativePaintedItem::geometryChanged(newGeometry, oldGeometry);
      }
      

        1. main.qml
          1 kB
          Qt Support
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            mitch_curtis Mitch Curtis
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes