| 366 | } |
| 367 | |
| 368 | void EditorTest::modifyCustomModel() |
| 369 | { |
| 370 | QString file_xml = readFile(":/crossdoor_with_subtree.xml"); |
| 371 | main_win->on_actionClear_triggered(); |
| 372 | main_win->loadFromXML( file_xml ); |
| 373 | |
| 374 | QAbstractButton *button_lock = main_win->findChild<QAbstractButton*>("buttonLock"); |
| 375 | button_lock->setChecked(false); |
| 376 | |
| 377 | auto sidepanel_editor = main_win->findChild<SidepanelEditor*>("SidepanelEditor"); |
| 378 | auto treeWidget = sidepanel_editor->findChild<QTreeWidget*>("paletteTreeWidget"); |
| 379 | |
| 380 | NodeModel jump_model = { NodeType::ACTION, |
| 381 | "JumpOutWindow", |
| 382 | { {"UseParachute", PortModel() } } |
| 383 | }; |
| 384 | |
| 385 | sidepanel_editor->onReplaceModel("PassThroughWindow", jump_model); |
| 386 | |
| 387 | auto pass_window_items = treeWidget->findItems("PassThroughWindow", |
| 388 | Qt::MatchExactly | Qt::MatchRecursive); |
| 389 | QCOMPARE( pass_window_items.empty(), true); |
| 390 | |
| 391 | auto jump_window_items = treeWidget->findItems( jump_model.registration_ID, |
| 392 | Qt::MatchExactly | Qt::MatchRecursive); |
| 393 | QCOMPARE( jump_window_items.size(), 1); |
| 394 | |
| 395 | auto abs_tree = getAbstractTree(); |
| 396 | |
| 397 | auto jump_abs_node = abs_tree.findFirstNode( jump_model.registration_ID ); |
| 398 | QVERIFY( jump_abs_node != nullptr); |
| 399 | sleepAndRefresh( 500 ); |
| 400 | QCOMPARE( jump_abs_node->model, jump_model ); |
| 401 | |
| 402 | sleepAndRefresh( 500 ); |
| 403 | } |
| 404 | |
| 405 | void EditorTest::multipleSubtrees() |
| 406 | { |
nothing calls this directly
no test coverage detected