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

Method editText

test/editor_test.cpp:429–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429void EditorTest::editText()
430{
431 QString file_xml = readFile("://show_all.xml");
432 main_win->on_actionClear_triggered();
433 main_win->loadFromXML( file_xml );
434
435 auto abs_tree = getAbstractTree();
436
437 std::list<QLineEdit*> line_editable;
438
439 for(const auto& node: abs_tree.nodes())
440 {
441 auto lines = node.graphic_node->nodeDataModel()->embeddedWidget()->findChildren<QLineEdit*>();
442 for(const auto& line: lines)
443 {
444 if( line->isReadOnly() == false && line->isHidden() == false)
445 {
446 line_editable.push_back( line );
447 }
448 }
449 }
450
451 auto container = main_win->currentTabInfo();
452 auto view = container->view();
453
454 for(const auto& line: line_editable)
455 {
456 QTest::mouseDClick( line, Qt::LeftButton );
457 line->selectAll();
458 sleepAndRefresh( 50 );
459
460 QTest::keyClick(line, Qt::Key_Delete, Qt::NoModifier );
461 sleepAndRefresh( 50 );
462 QCOMPARE( line->text(), QString() );
463
464 QTest::mouseClick( line, Qt::LeftButton );
465 sleepAndRefresh( 50 );
466 QTest::keyClicks(view->viewport(), "was_here");
467 QCOMPARE( line->text(), tr("was_here") );
468 }
469
470 sleepAndRefresh( 500 );
471}
472
473void EditorTest::loadModelLess()
474{

Callers

nothing calls this directly

Calls 5

loadFromXMLMethod · 0.80
embeddedWidgetMethod · 0.80
currentTabInfoMethod · 0.80
viewMethod · 0.80

Tested by

no test coverage detected