Results 1 to 5 of 5

Thread: QTextDocument - getting last modified QTextFragment objects

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: QTextDocument - getting last modified QTextFragment objects

    Right now I don't know such a function, but (as for user changes) the cursor is on the last changed fragment. So may be that is enough for you.

  2. #2
    Join Date
    Aug 2008
    Posts
    50
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: QTextDocument - getting last modified QTextFragment objects

    Quote Originally Posted by Lykurg View Post
    Right now I don't know such a function, but (as for user changes) the cursor is on the last changed fragment. So may be that is enough for you.
    Probably not.

    I wont this:
    example 1:
    1) user have empty QTextDocument object, so object_ptr->isModified() returns false,
    2) user added some rich text, so object_ptr->isModified() returns true,
    3) user clicked 'add image' icon and afterwards application execute object_ptr->setModified(false),
    4) in this moment I wont get QTextFragment or QTextBlock objects which contains 'some rich text' added by user in point 2.

    example 2:
    1) user have QTextDocument object which contains some rich text with images and object_ptr->isModified() returns false,
    2) user deleted(by normal edit) some rich text with images, so object_ptr->isModified() returns true,
    3) user clicked 'add image' icon and afterwards application execute object_ptr->setModified(false),
    4) in this moment I wont get QTextFragment or QTextBlock objects which contains 'some rich text with images' deleted by user in point 2.

    I think one of solutions is cloning QTextDocument in point 1 and comparing with current QTextDocument in point 4. But this solution is too hangry of memory and CPU time.

Similar Threads

  1. Replies: 1
    Last Post: 20th February 2010, 10:28
  2. URL last modified
    By tsd-charlie in forum Qt Programming
    Replies: 1
    Last Post: 2nd October 2009, 15:09
  3. Modified TextFinder example
    By LoomVortex in forum Newbie
    Replies: 4
    Last Post: 26th August 2009, 11:17
  4. modified files
    By Raajesh in forum Qt Programming
    Replies: 1
    Last Post: 20th May 2008, 13:17
  5. Modified tableview
    By dkite in forum Qt Programming
    Replies: 2
    Last Post: 14th March 2006, 01:58

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
  •  
Qt is a trademark of The Qt Company.