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

QTextDocument: give the possibility to insert a frame before the first block

XMLWordPrintable

      When a QTextDocument is created, a first text block is automatically created to handle the initial text. The problem is that it is not possible to insert anything before this block.

      For example, if the top left corner of the document must be a frame, given the following code, the frame is inserted after the first line, even if there is no text:
      #include <QtGui>

      int main(int argc, char **argv){
      QApplication app(argc, argv);
      QTextEdit textEdit;
      textEdit.show();

      QTextCursor cursor = textEdit.textCursor();
      QTextFrameFormat rightFormat;
      rightFormat.setWidth(15);
      rightFormat.setBorder(1);
      rightFormat.setPosition(QTextFrameFormat::FloatLeft);
      cursor.insertFrame(rightFormat);
      return app.exec();
      }

      It would be nice to be able to add frames as the first part of the first part of the document.

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

            esabraha Eskil Abrahamsen Blomfeldt
            poulain Benjamin Poulain (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes