Skip to content

Commit e71d4d7

Browse files
committed
more attempts to fix multiframe undo
1 parent f04d438 commit e71d4d7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/src/core/testqgslayoutmultiframe.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,26 @@ void TestQgsLayoutMultiFrame::undoRedoRemovedFrame()
453453

454454
QCOMPARE( htmlItem->frameCount(), 1 );
455455

456+
auto dumpStack = [ = ]
457+
{
458+
// dump stack
459+
for ( int i = 0; i < mLayout->undoStack()->stack()->count(); ++i )
460+
{
461+
QgsDebugMsg( QString( "%1: %2 %3" ).arg( i ).arg( mLayout->undoStack()->stack()->command( i )->text(), i + 1 == mLayout->undoStack()->stack()->index() ? QString( "<---" ) : QString() ) );
462+
}
463+
};
464+
dumpStack();
456465
//undo changes
457466

458467
//multiframe command
459468
mLayout->undoStack()->stack()->undo();
469+
dumpStack();
460470
//frame 2 command
461471
mLayout->undoStack()->stack()->undo();
472+
dumpStack();
462473
//frame 1 command
463474
mLayout->undoStack()->stack()->undo();
475+
dumpStack();
464476
//check result
465477
QVERIFY( htmlItem->frameCount() > 1 );
466478
QCOMPARE( htmlItem->frame( 0 )->frameStrokeWidth().length(), 0.3 );
@@ -470,8 +482,10 @@ void TestQgsLayoutMultiFrame::undoRedoRemovedFrame()
470482

471483
//frame 1 command
472484
mLayout->undoStack()->stack()->redo();
485+
dumpStack();
473486
//frame 2 command
474487
mLayout->undoStack()->stack()->redo();
488+
dumpStack();
475489

476490
//check result
477491
QVERIFY( htmlItem->frameCount() > 1 );

0 commit comments

Comments
 (0)