コード例 #1
0
ファイル: treeview.cpp プロジェクト: munglaub/silence
void TreeView::setupToolbar()
{
	ActionManager *ac = Controller::create()->getActionManager();
	toolbar = new QToolBar();

	addRowAction = ac->getGlobalAction(Actions::ADD_NODE);
	toolbar->addAction(addRowAction);
	connect(addRowAction, SIGNAL(triggered()), this, SLOT(addRow()));

	addChildAction = ac->getGlobalAction(Actions::ADD_SUBNODE);
	toolbar->addAction(addChildAction);
	connect(addChildAction, SIGNAL(triggered()), this, SLOT(addChild()));

	removeAction = ac->getGlobalAction(Actions::REMOVE_NODE);
	toolbar->addAction(removeAction);
	connect(removeAction, SIGNAL(triggered()), questionFrame, SLOT(show()));

	toolbar->addSeparator();

	propertyAction = ac->getGlobalAction(Actions::SHOW_NODE_PROPERTIES);
	toolbar->addAction(propertyAction);
	connect(propertyAction, SIGNAL(triggered()), Controller::create()->getNodePropertyWidget(), SLOT(show()));

	welcomeAction = ac->getGlobalAction(Actions::SHOW_WELCOMEVIEW);
	toolbar->addAction(welcomeAction);
	connect(welcomeAction, SIGNAL(triggered(bool)), this, SLOT(showWelcomeView()));
}