how to remove a qtextblock completely
-
Hi,
I want to vertically align two QTextFrames each consisting of a QTextTable, so that they are next to eachother.
The problem is whenever I insert a QTextFrame a block is inserted right before the frame,
which I can't get rid of putting an unwanted offset to the vertical position.
Due to that the second Frame is placed one blocksize below the other frame.This is what I tried to remove the unwanted QTextBlocks
QTextCursor blockCursor = QTextCursor(testDoc.firstBlock()); blockCursor.setBlockFormat(blockFormat); blockCursor.select(QTextCursor::BlockUnderCursor); blockCursor.removeSelectedText(); blockCursor.deletePreviousChar(); blockCursor.deleteChar(); blockCursor.deleteChar();
It doesn't remove the block though, I've colored it yellow and it's still visible in addition to the offset..
My only workaround for now is to set the blocks lineheight to 0 pixels, but that doesn't look good in code,
but it places both frames to the desired same height. Is there any other way to align two Frames correctly and or why is there no function for explicitly deleting blocks? Why is a QTextblock even inserted in the first place when you insert a frame?Thanky you