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

Basic TextArea functionality depends on C++

    XMLWordPrintable

Details

    • 045f9ce19 (dev)

    Description

      The following TextArea-based editor example shows that even basic features such as bold/not-bold seem to depend on the C++-only features of QTextDocument:

      https://qt-project.org/doc/qt-5.1/qtquickcontrols/text.html

      The QML code reads:

      onTriggered: document.bold = !document.bold

      When document is a DocumentHandler that manipulates the underlying QTextDocument of the TextArea.

      Besides being limiting to pure QML code, this is even more of an issue when we consider that the manipulation of that underlying QTextDocument is itself vaguely defined. The documentation reads:

      Warning: The QTextDocument provided is used internally by Qt Quick
      elements to provide text manipulation primitives. You are not
      allowed to perform any modification of the internal state of the
      QTextDocument. If you do, the element in question may stop
      functioning or crash.

      So not only one has to resort to the C++ API for basic manipulation of the TextArea, but it's unclear which of these operations are in fact safe.

      It would be useful to have more of that API clearly and cleanly exposed to QML code.

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              niemeyer Gustavo Niemeyer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes