Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to remove a qtextblock completely
Forum Updated to NodeBB v4.3 + New Features

how to remove a qtextblock completely

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 189 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qt3.14
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved