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. Ideas to custom bookmark feature
Forum Updated to NodeBB v4.3 + New Features

Ideas to custom bookmark feature

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

    Hi,
    My application already has a undo/redo feature where I push/pop some action into containers such as QUndoGroup and QUndoStack. The functionality works fine.
    However, I need another bookmark like feature, where clicking one of the bookmark will trigger an action that is already been recorded. Many such bookmarks can exist for each tab. This can otherwise be termed as save/restore feature.

    Consider it as an advanced version of QUndoFramework, where the actions go last in first out (LIFO) while in my requirement, I can trigger any action from anywhere of the stack.


    | A1 |

    | A2 |

    | A3 |

    | A4 |

    Here I can save A3 action in some container and clicking it will perform that action.

    Can anyone pitch me some ideas on how to do it?

    JonBJ 1 Reply Last reply
    0
    • V vijaychsk

      Hi,
      My application already has a undo/redo feature where I push/pop some action into containers such as QUndoGroup and QUndoStack. The functionality works fine.
      However, I need another bookmark like feature, where clicking one of the bookmark will trigger an action that is already been recorded. Many such bookmarks can exist for each tab. This can otherwise be termed as save/restore feature.

      Consider it as an advanced version of QUndoFramework, where the actions go last in first out (LIFO) while in my requirement, I can trigger any action from anywhere of the stack.


      | A1 |

      | A2 |

      | A3 |

      | A4 |

      Here I can save A3 action in some container and clicking it will perform that action.

      Can anyone pitch me some ideas on how to do it?

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

      @vijaychsk
      I can just say this: the QUndoStack explicitly forbids (at least writable) access to anything in the stack other than the topmost, in a LIFO order. This obviously corresponds to an "undo-redo" functionality.

      const QUndoCommand *QUndoStack::command(int index) const

      Returns a const pointer to the command at index.

      This function returns a const pointer, because modifying a command, once it has been pushed onto the stack and executed, almost always causes corruption of the state of the document, if the command is later undone or redone.

      Your requirement of picking up some previous action from anywhere and then executing it ("where clicking one of the bookmark will trigger an action that is already been recorded") does not correspond to anything in an "undo" sense. You can still use that method to access an old action and your own code to execute it from where you are now, but I don't see it related to undo/redoing.

      V JonBJ 2 Replies Last reply
      1
      • JonBJ JonB

        @vijaychsk
        I can just say this: the QUndoStack explicitly forbids (at least writable) access to anything in the stack other than the topmost, in a LIFO order. This obviously corresponds to an "undo-redo" functionality.

        const QUndoCommand *QUndoStack::command(int index) const

        Returns a const pointer to the command at index.

        This function returns a const pointer, because modifying a command, once it has been pushed onto the stack and executed, almost always causes corruption of the state of the document, if the command is later undone or redone.

        Your requirement of picking up some previous action from anywhere and then executing it ("where clicking one of the bookmark will trigger an action that is already been recorded") does not correspond to anything in an "undo" sense. You can still use that method to access an old action and your own code to execute it from where you are now, but I don't see it related to undo/redoing.

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

        @JonB OK. It is not related to undo/redo functionality. Do you have other suggestions where I can bring up my "bookmark" kind of feature indpendently?

        1 Reply Last reply
        0
        • JonBJ JonB

          @vijaychsk
          I can just say this: the QUndoStack explicitly forbids (at least writable) access to anything in the stack other than the topmost, in a LIFO order. This obviously corresponds to an "undo-redo" functionality.

          const QUndoCommand *QUndoStack::command(int index) const

          Returns a const pointer to the command at index.

          This function returns a const pointer, because modifying a command, once it has been pushed onto the stack and executed, almost always causes corruption of the state of the document, if the command is later undone or redone.

          Your requirement of picking up some previous action from anywhere and then executing it ("where clicking one of the bookmark will trigger an action that is already been recorded") does not correspond to anything in an "undo" sense. You can still use that method to access an old action and your own code to execute it from where you are now, but I don't see it related to undo/redoing.

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

          @vijaychsk

          @JonB said in Ideas to custom bookmark feature:

          You can still use that method to access an old action and your own code to execute it from where you are now

          ?

          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