Results 1 to 4 of 4

Thread: Deleting a QTextFrame in a QTextDocument

  1. #1
    Join Date
    Aug 2009
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Deleting a QTextFrame in a QTextDocument

    I can successfully insert blocks and frames in a QTextDocument. I see no way to delete any of those frames and/or blocks.

    QTextEdit::cut() deletes selected text from a QTextEdit. (doesn't seem to work for me either) but according to the documentation, not from the document (?).

    Can I delete a frame and any containing blocks from a document. If so, how?

    Appreciate any help,
    Enno

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Deleting a QTextFrame in a QTextDocument

    Calling delete on the QTextFrame pointer will destroy the frame and remove it from the QTextDocument it belongs to. You can get the currentFrame() from a suitably positioned QTextCursor (this may be the rootFrame()). AFAICT, QTextBlocks will be removed automatically when you remove the frame containing them or QTextCursor::removeSelectedText().

  3. The following user says thank you to ChrisW67 for this useful post:

    enno (9th November 2015)

  4. #3
    Join Date
    Aug 2013
    Location
    India
    Posts
    44
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Deleting a QTextFrame in a QTextDocument

    hey please tell me how to insert block/frames in qtextdocument.

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Deleting a QTextFrame in a QTextDocument


Similar Threads

  1. Replies: 0
    Last Post: 11th November 2010, 09:58
  2. Deleting a file
    By chandan in forum Newbie
    Replies: 5
    Last Post: 12th August 2010, 15:30
  3. Deleting a Folder
    By GTBuilder in forum Newbie
    Replies: 9
    Last Post: 29th September 2009, 07:22
  4. QTextFrame::iterator richtext QTextDocument problem?
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 20th July 2007, 02:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.