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. Undo redo for vtk widgets

Undo redo for vtk widgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 615 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.
  • Z Offline
    Z Offline
    zandarina
    wrote on last edited by
    #1

    Dear all,

    I read that qt has implemented the undo and redo operations for widgets in qt using the undo stack. I wonder if this class can only be used for vtk widgets. Or I have to implement this option from the beginning as qt does not support this feature for vtk objects.

    Thank you very much

    1 Reply Last reply
    0
    • gde23G Offline
      gde23G Offline
      gde23
      wrote on last edited by
      #2

      What exactly do you want to undo on the VTKWidget, since typically it will just render some data and not provide any data manipulation actions.
      The Undo Framework will store actions and their undo couterparts. This will work in general for any widget no matter if it is VTK or whatever, but you need to implement it yourself.

      1 Reply Last reply
      3
      • Z Offline
        Z Offline
        zandarina
        wrote on last edited by zandarina
        #3

        I would like to undo or redo like any other software for example the addition of a widget if I apply an undo to delete it or undo a translation or a rotation of a vtkboxwidget to go to the previous status before the user moved it in the end of interaction or a movement of a control point of the spline to undo the change of the control point to the previous state. I wonder if there was something already implemented such as this undo stack of qt that I can use or i have to implement the undo and redo stacks by myself from the beginning. I checked the vtkundo implemented only in paraview (not a vtk class) and it seems that it will be the case.

        Thanks

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

          Hi,

          Use QUndoStack. You'll have to create your set of commands.

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

          Z 1 Reply Last reply
          2
          • SGaistS SGaist

            Hi,

            Use QUndoStack. You'll have to create your set of commands.

            Z Offline
            Z Offline
            zandarina
            wrote on last edited by
            #5

            @SGaist But this cannot be used for vtk widgets only qt objects. I think it must be implemented from the very beginning as paraview does.

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

              @zandarina why can it not be used with VTK widgets ? The QUndo framework is not tied to any specific widgets type. It's generic.

              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