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

Expose QLabel's QTextCursor to the public API

XMLWordPrintable

      QLabel allows to set rich text on it, but there is no way to get selected rich text out of it.

      QString richText = label.textCursor().selection().toHtml();

      would be pretty convenient.

      I have noticed that if one selects some text with html-inserted images in a QLabel and drag'n'drops the selection into a QTextEdit, the whole selection, including the selected images, gets copied in the QTextEdit, meaning that the QTextEdit has some way of getting the selected rich text out of the QLabel.
      Would be nice if something like that, something that allows to get selected rich text in a QLabel, was in the public API.

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

            esabraha Eskil Abrahamsen Blomfeldt
            nurupo nurupo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes