Details
-
Bug
-
Resolution: Out of scope
-
P4: Low
-
4.1.3
-
None
Description
There are layout problems in QTextEdit related to text frames, where text flows along the right hand side.
- The yellow background of the text block floating at the right hand side of the frame covers part of the frame.
- The left margin property of the text block is not obeyed when floating beside the frame.
Example program:
#include <QApplication>
#include <QTextEdit>
#include <QTextCursor>
#include <QTextFrameFormat>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QTextEdit edit;
QString text = "Test Test Test Test Test Test Test Test Test Test Test "
"Test Test Test Test Test Test Test Test Test Test Test.";
edit.append(text);
QTextCursor c = edit.textCursor();
c.movePosition(QTextCursor::End);
QTextFrameFormat ff;
ff.setBorder(1);
ff.setPosition(QTextFrameFormat::FloatLeft);
ff.setWidth(120);
c.insertFrame(ff);
c.insertText(text);
c.movePosition(QTextCursor::End);
c.insertBlock();
QTextBlockFormat bf;
bf.setBackground(Qt::yellow);
bf.setLeftMargin(10);
c.insertBlock(bf);
c.insertText(text);
edit.show();
return app.exec();
}
Note: This requires bigger changes in the layouting process to obey frame ordering.