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. Undostack decrement problem
QtWS25 Last Chance

Undostack decrement problem

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 3.1k 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.
  • P Offline
    P Offline
    potla11
    wrote on last edited by
    #1

    some one please help me....i am creating a undo command in that undocommands's undo function i need to decrement the stack value 5 times how to do it...

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Including executing the undo-command or just "jumping over" it?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • P Offline
        P Offline
        potla11
        wrote on last edited by
        #3

        Thanks for the reply..actually "in my application at a time i am updating the color for 5 rectitems ..i was created a undocolourcommand but it was changing the rectitems to its previous color after pressing undo option 5 times..i don't want like that i want all rectitems to their previous color at a time"

        @

        foreach( QGraphicsItem *item, m_chip->parentItem()->childItems() )
        {

            qgraphicsitem_cast<Chip *>(item)->updateColor( m_oldColor );
        

        }
        @

        here m_chip is rectitem...the above code was not working now could you please help me.. how to do it

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          Seems like beginMacro() and endMacro() of [[Doc:QUndoStack]] is what you're looking for.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • P Offline
            P Offline
            potla11
            wrote on last edited by
            #5

            yes how to set begin macro()...is ther any need to use QUndoStackPrivate

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              Ah, I see. You did read the "description of macros":http://doc.qt.nokia.com/4.7/qundostack.html#command-compression-and-macros and the API docs of "QUndoStack::beginMacro() ":http://doc.qt.nokia.com/4.7/qundostack.html#beginMacro, but you just overlooked the example in the latter, didn't you?

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • P Offline
                P Offline
                potla11
                wrote on last edited by
                #7

                sorry to ask you again in the documents they are set some text for begining of macro ...according to my app how i will set the begining of macro...

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  We're not going to do you homework. That's up to you. The docs are pretty clear here. Why don't you just start to program and test the results? That's the usual way to go.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  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