Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Undo redo for vtk widgets

    General and Desktop
    3
    6
    169
    Loading More Posts
    • 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
      zandarina last edited by

      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 Reply Quote 0
      • gde23
        gde23 last edited by

        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 Reply Quote 3
        • Z
          zandarina last edited by zandarina

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 2
            • Z
              zandarina @SGaist last edited by

              @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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                @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 Reply Quote 0
                • First post
                  Last post