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

Improvements to text layouting in QML

    XMLWordPrintable

Details

    • I56dc0c1c4b575dc06360c135098024d0324d3656

    Description

      Description

      Allow more control over the text layouting process in QML.

      Give access to every text line through a hook, this gives the opportunity to position and resize a line as it is being laid out.
      It is then possible to lay out the text in columns or around other objects.

      line.number (read-only)
      line.x
      line.y
      line.width
      line.height
      

      The behaviour of the text element (wrapping, sizing) should be preserved if possible.

      Example code

      Text {
          id: layout
          text: "..."
          width: 200
          onLineLaidOut: {
              if (line.number < 5) {
                  line.x = 100
                  line.width = line.width - 100
              }
          }
      }
      

      Make sure onLineLaidOut is not emitted if not connected.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-21367
          # Subject Branch Project Status CR V

          Activity

            People

              bodson Yann Bodson (Inactive)
              bodson Yann Bodson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes