Test::TestGroup* Test::TestGroup::getFirstTest() { TestGroup* current = getFirstLeaf(); if (!current || current->isTest()) return current; return getNextTest(current); }
void Block::assignHighlighting(TreeElement *el) // todo - remove hardcoded vales such as "declarator" { if (el->isLeaf()) { highlightFormat = group->docScene->getDefaultFormat(); if (el->getParent()) { QString parentType = el->getParent()->getType(); if (group->docScene->hasFormatFor(parentType) && !el->getParent()->getType().startsWith("funct_")) { highlightFormat = group->docScene->getFormatFor(parentType); } } highlight(highlightFormat); } else { if (group->docScene->hasFormatFor(el->getType())) { QPair<QFont, QColor> highlightFormat = group->docScene->getFormatFor(el->getType()); if (!el->getType().compare("funct_call")) { getFirstLeaf()->highlight(highlightFormat); } else if (!el->getType().compare("funct_definition")) { QList<Block*> blocks = childBlocks(); foreach(Block* block, blocks) { if (!block->element->getType().compare("declarator")) { block->getFirstLeaf()->highlight(highlightFormat); break; } } } }