MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / clearModels

Method clearModels

test/editor_test.cpp:508–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508void EditorTest::clearModels()
509{
510 QString file_xml = readFile(":/crossdoor_with_subtree.xml");
511 main_win->on_actionClear_triggered();
512 main_win->loadFromXML( file_xml );
513
514 file_xml = readFile(":/show_all.xml");
515 main_win->on_actionClear_triggered();
516 main_win->loadFromXML( file_xml );
517
518 auto container = main_win->currentTabInfo();
519 // auto view = container->view();
520
521 auto abs_tree = getAbstractTree();
522 auto node = abs_tree.findFirstNode( "DoSequenceStar" );
523
524 QTimer::singleShot(300, [&]()
525 {
526 // No message box expected
527 QWidget* modal_widget = QApplication::activeModalWidget();
528
529 if (dynamic_cast<QMessageBox*>(modal_widget))
530 {
531 QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier);
532 QCoreApplication::postEvent(modal_widget, event);
533 QFAIL("no QMessageBox");
534 }
535 });
536
537 container->createSubtree( *node->graphic_node, "DoorClosed" );
538}
539
540void EditorTest::undoWithSubtreeExpanded()
541{

Callers

nothing calls this directly

Calls 5

loadFromXMLMethod · 0.80
currentTabInfoMethod · 0.80
findFirstNodeMethod · 0.80
createSubtreeMethod · 0.80

Tested by

no test coverage detected