Undostack decrement problem
-
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...
-
Including executing the undo-command or just "jumping over" it?
-
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
-
Seems like beginMacro() and endMacro() of [[Doc:QUndoStack]] is what you're looking for.
-
yes how to set begin macro()...is ther any need to use QUndoStackPrivate
-
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?
-
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...
-
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.