Undostack decrement problem
-
wrote on 4 Oct 2011, 05:17 last edited by
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...
-
wrote on 4 Oct 2011, 11:05 last edited by
Including executing the undo-command or just "jumping over" it?
-
wrote on 4 Oct 2011, 12:35 last edited by
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
-
wrote on 4 Oct 2011, 12:44 last edited by
Seems like beginMacro() and endMacro() of [[Doc:QUndoStack]] is what you're looking for.
-
wrote on 4 Oct 2011, 12:49 last edited by
yes how to set begin macro()...is ther any need to use QUndoStackPrivate
-
wrote on 4 Oct 2011, 12:56 last edited by
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?
-
wrote on 4 Oct 2011, 13:07 last edited by
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...
-
wrote on 4 Oct 2011, 13:37 last edited by
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.
1/8