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. Need help on Qt Undo framework

Need help on Qt Undo framework

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    haney
    wrote on last edited by
    #1

    Hi,

    I want to implement Qt undo/redo framework in my project. I have a QGridLayout with 6 QComboBoxes and a QLineEdit and a few labels arranged properly. Now when user modifies value of lineedit or combobox, I need to capture the changes and have to provide undo/redo option for the values.

    Please let me know how to start with this feature. Since we need to push QUndoCommand do we need to have all the widgets and their values inherited from QUndoCommand.

    Kindly share your views. Thanks in advance.

    Best regards,
    Haney....

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      It all depends on how things are related between your widgets. Did you already looked at the "Undo Framework Example" ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • H Offline
        H Offline
        haney
        wrote on last edited by
        #3

        Thanks for ur reply. Yes, I went thru the Undo framework example.
        My feature requirement is simple, I have widgets and associated signals and slots which is done and fine. Now any user changes to widgets values, I want to enable undo/redo options accordingly.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then if it's just a question of setting some values back, you can create a QUndoCommand derived class for each type of widget and you should be good to go.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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