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. QUndoStack with dropdown
Forum Updated to NodeBB v4.3 + New Features

QUndoStack with dropdown

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 5 Posters 509 Views 2 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.
  • V Offline
    V Offline
    vijaychsk
    wrote on last edited by
    #1

    Hi,
    I want to implement a undo button that shows a list of undo actions to choose from. For example, like in Microsoft Office where I can choose from a list of actions. I can directly jump to the past 10th action instead of clicking undo button 10 times.
    In the Qt tutorial, only QUndoView usage with an external window.

    Any idea I can do a similar thing without an extra window but with a dropdown?
    Any examples that someone can point me to?

    eyllanescE artwawA 2 Replies Last reply
    0
    • V vijaychsk

      Hi,
      I want to implement a undo button that shows a list of undo actions to choose from. For example, like in Microsoft Office where I can choose from a list of actions. I can directly jump to the past 10th action instead of clicking undo button 10 times.
      In the Qt tutorial, only QUndoView usage with an external window.

      Any idea I can do a similar thing without an extra window but with a dropdown?
      Any examples that someone can point me to?

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @vijaychsk From what I understand you want to implement the same example from the tutorial but instead of seeing the QUndoView you want a QComboBox. I am right?

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      V 1 Reply Last reply
      2
      • V vijaychsk

        Hi,
        I want to implement a undo button that shows a list of undo actions to choose from. For example, like in Microsoft Office where I can choose from a list of actions. I can directly jump to the past 10th action instead of clicking undo button 10 times.
        In the Qt tutorial, only QUndoView usage with an external window.

        Any idea I can do a similar thing without an extra window but with a dropdown?
        Any examples that someone can point me to?

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by
        #3

        @vijaychsk There is nothing that can stop you, I think. I never did it myself but I think it is entirely doable - you just add actions descriptions and index to the combo box and then push them to the stack. To get the action back you use that stored index. Grouping would also need to be implemented.
        So, in theory, you'd just need to reimplement undo view using the stack as a store for undo actions.

        For more information please re-read.

        Kind Regards,
        Artur

        1 Reply Last reply
        0
        • eyllanescE eyllanesc

          @vijaychsk From what I understand you want to implement the same example from the tutorial but instead of seeing the QUndoView you want a QComboBox. I am right?

          V Offline
          V Offline
          vijaychsk
          wrote on last edited by
          #4

          @eyllanesc Correct.

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

            Hi,

            You would need to implement your own model to set on the QComboBox. The one used by QUndoView is implemented beside the class implementation.

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

            JonBJ 1 Reply Last reply
            1
            • V Offline
              V Offline
              vijaychsk
              wrote on last edited by
              #6

              aa1a9353-332f-40ce-9b38-2ed588baac78-image.png
              Something like this.

              1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                You would need to implement your own model to set on the QComboBox. The one used by QUndoView is implemented beside the class implementation.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #7

                @SGaist said in QUndoStack with dropdown:

                You would need to implement your own model to set on the QComboBox.

                @vijaychsk
                Given what @SGaist is pointing it out here, you would have to write some code to replicate the functionality. Using your button to icon to "pop up" a QUndoView in some shape or form sounds like less work than utilising a QComboBox. You might want to bear that in mind.

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved