|
@@ -32,17 +32,19 @@ void IndexSystemWidget::initLayout()
|
|
|
|
|
|
void IndexSystemWidget::contextMenuEvent(QContextMenuEvent *event)
|
|
void IndexSystemWidget::contextMenuEvent(QContextMenuEvent *event)
|
|
{
|
|
{
|
|
|
|
+ qDebug() << __FUNCTION__ << __LINE__ << endl;
|
|
|
|
+
|
|
QMenu *menu = new QMenu();
|
|
QMenu *menu = new QMenu();
|
|
|
|
|
|
- QAction *selectAction = menu->addAction("全选");
|
|
|
|
- connect(selectAction, &QAction::triggered, this, &IndexSystemWidget::slotSelectAllNodes);
|
|
|
|
|
|
+ QAction *act1 = menu->addAction("全选");
|
|
|
|
+ connect(act1, &QAction::triggered, this, &IndexSystemWidget::slotSelectAllNodes);
|
|
|
|
|
|
- QAction *clearAction = menu->addAction("清空");
|
|
|
|
- connect(clearAction, &QAction::triggered, this, &IndexSystemWidget::slotClearAllNodes);
|
|
|
|
|
|
+ QAction *act2 = menu->addAction("清空");
|
|
|
|
+ connect(act2, &QAction::triggered, this, &IndexSystemWidget::slotClearAllNodes);
|
|
|
|
|
|
if (m_mindView->mind() != nullptr && m_mindView->mind()->nodeList().count() <= 0) {
|
|
if (m_mindView->mind() != nullptr && m_mindView->mind()->nodeList().count() <= 0) {
|
|
- QAction *root = menu->addAction("创建根节点");
|
|
|
|
- connect(root, &QAction::triggered, this, &IndexSystemWidget::slotCreateRootNode);
|
|
|
|
|
|
+ QAction *act3 = menu->addAction("创建根节点");
|
|
|
|
+ connect(act3, &QAction::triggered, this, &IndexSystemWidget::slotCreateRootNode);
|
|
}
|
|
}
|
|
|
|
|
|
menu->exec(event->globalPos());
|
|
menu->exec(event->globalPos());
|
|
@@ -66,6 +68,5 @@ void IndexSystemWidget::slotCreateRootNode()
|
|
|
|
|
|
CNodeData n = CNodeData(m_proj->id, m_type, 0);
|
|
CNodeData n = CNodeData(m_proj->id, m_type, 0);
|
|
n.name = m_proj->projectName;
|
|
n.name = m_proj->projectName;
|
|
- m_mindView->mind()->addNode(n);
|
|
|
|
- m_mindView->refresh();
|
|
|
|
|
|
+ m_mindView->addNode(n);
|
|
}
|
|
}
|