I have a QTreeWidget with rows:
A
B
C
D
and commands:
1:
stack->undo(); // insertTopLevelItem( 0, newitem );
QUndoStack *stack = new QUndoStack();
stack->push( new InsertCommand( new QTreeWidgetItem(), 0 ) );
stack->undo(); // insertTopLevelItem( 0, newitem );
To copy to clipboard, switch view to plain text mode
Result:
NewItem
A
B
C
D
2:
cmd->undo(); //insertTopLevelItem( 0, newitem );
InsertCommand *cmd = new InsertCommand( new QTreeWidgetItem(), 0 );
cmd->undo(); //insertTopLevelItem( 0, newitem );
To copy to clipboard, switch view to plain text mode
Result:
NewItem
B
C
D
Why I have two different results. What's the difference between 1 and 2?
Bookmarks