Results 1 to 3 of 3

Thread: QTextDocument - how to limit maximum undo/redo steps

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

    Default QTextDocument - how to limit maximum undo/redo steps

    Hello.

    Qt have:
    Qt Code:
    1. int QTextDocument::availableRedoSteps () const
    2. int QTextDocument::availableUndoSteps () const
    To copy to clipboard, switch view to plain text mode 
    but how can I set maximum undo/redo steps? Is it possible at all?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTextDocument - how to limit maximum undo/redo steps

    You can probably hack into the undo/redo framework using QObject::findChild() but first you have to check in Qt's source code what to look for. There is no simple call in the API to do what you want directly.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    lukass (30th October 2010)

  4. #3
    Join Date
    Jul 2015
    Posts
    22
    Thanks
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextDocument - how to limit maximum undo/redo steps

    Does searching QUndoStack among children work for you? I tried but this did not work for me. Or is there any trick that I missed?

Similar Threads

  1. undo/redo example has refactored
    By n_vova in forum Qt Programming
    Replies: 1
    Last Post: 10th May 2012, 10:04
  2. Undo/Redo issues of QTextEdit
    By Maximka in forum Newbie
    Replies: 0
    Last Post: 22nd February 2010, 07:36
  3. QTextEdit undo/redo
    By Derf in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2009, 09:12
  4. Detecting a action ( undo/ redo)
    By ankurjain in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2006, 05:05
  5. Implement Undo Redo
    By ankurjain in forum Qt Programming
    Replies: 5
    Last Post: 28th March 2006, 13:17

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.