Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
4.5.0
-
None
Description
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.