AnnotationWidget::AnnotationWidget(QWidget *parent) : QDialog(parent) { setWindowIcon(QIcon(":/images/icons/graph.png")); setWindowTitle("Annotation"); tabs = new QTabWidget(this); treeviewTab = new ToolsTreeviewTab(this); commandsTab = new ToolsCommandsTab(this); tabs->addTab(treeviewTab, "Tree View"); tabs->addTab(commandsTab, "Commands"); treeCountLabel = new QLabel("Total Tree Count: 0"); nodeCountLabel = new QLabel("Total Node Count: 0"); nodeCountLabel->setToolTip("Total number of nodes in the skeleton."); listedNodesLabel = new QLabel("Currently Listed Nodes: 0"); listedNodesLabel->setToolTip("Number of nodes currently listed in the table."); QHBoxLayout *hLayout = new QHBoxLayout(); QHBoxLayout *subHLayout = new QHBoxLayout(); subHLayout->addWidget(listedNodesLabel, 0, Qt::AlignLeft); subHLayout->addWidget(nodeCountLabel, 0, Qt::AlignRight); hLayout->addWidget(treeCountLabel); hLayout->addLayout(subHLayout); mainLayout = new QVBoxLayout(this); mainLayout->addWidget(tabs); mainLayout->addLayout(hLayout); setLayout(mainLayout); connect(treeviewTab, &ToolsTreeviewTab::updateAnnotationLabelsSignal, this, &AnnotationWidget::updateLabels); connect(commandsTab, SIGNAL(treeActivatedSignal()), treeviewTab, SLOT(treeActivated())); connect(commandsTab, SIGNAL(treeAddedSignal(treeListElement*)), treeviewTab, SLOT(treeAdded(treeListElement*))); connect(commandsTab, SIGNAL(nodeActivatedSignal()), treeviewTab, SLOT(nodeActivated())); connect(commandsTab, SIGNAL(branchPushedSignal()), treeviewTab, SLOT(branchPushed())); connect(commandsTab, SIGNAL(branchPoppedSignal()), treeviewTab, SLOT(branchPopped())); this->setWindowFlags(this->windowFlags() & (~Qt::WindowContextHelpButtonHint)); }
void ToolsCommandsTab::popBranchButtonClicked() { if(popBranchNodeSignal()) { branchesOnStackLabel->setText(QString("On Stack: %1").arg(state->skeletonState->branchStack->elementsOnStack)); emit branchPoppedSignal(); } }