Пример #1
0
SubDomain* Project::BuildSubdomain(QString subdomainName)
{
	SubDomain *newSubdomain = new SubDomain(subdomainName, projectFile, this);

	connect(newSubdomain, SIGNAL(mouseX(float)), this, SIGNAL(mouseX(float)));
	connect(newSubdomain, SIGNAL(mouseY(float)), this, SIGNAL(mouseY(float)));
	connect(newSubdomain, SIGNAL(undoAvailable(bool)), this, SIGNAL(undoAvailable(bool)));
	connect(newSubdomain, SIGNAL(redoAvailable(bool)), this, SIGNAL(redoAvailable(bool)));
	connect(newSubdomain, SIGNAL(editNode(uint,QString,QString,QString)),
		this, SIGNAL(editNode(uint,QString,QString,QString)));

	if (progressBar)
		newSubdomain->SetProgressBar(progressBar);

	subDomains.push_back(newSubdomain);
	emit subdomainCreated(subdomainName);
	return newSubdomain;
}
Пример #2
0
void MindMapWindow::createActions()
{
    // create mind map action
    _createMindMapAction = new QAction(tr("Create a new mind map"), this);
    _createMindMapAction->setIcon(QIcon("Resources\\new.png"));
    _createMindMapAction->setStatusTip(tr("create a new mind map"));
    connect(_createMindMapAction, SIGNAL(triggered()), this, SLOT(createMindMap()));
    // open mind map action
    _openMindMapAction = new QAction(tr("Open a new mind map"), this);
    _openMindMapAction->setIcon(QIcon("Resources\\open.png"));
    _openMindMapAction->setStatusTip(tr("open a new mind map"));
    connect(_openMindMapAction, SIGNAL(triggered()), this, SLOT(openMindMap()));
    // save mind map action
    _saveMindMapAction = new QAction(tr("Save a new mind map"), this);
    _saveMindMapAction->setIcon(QIcon("Resources\\save.png"));
    _saveMindMapAction->setStatusTip(tr("save a new mind map"));
    connect(_saveMindMapAction, SIGNAL(triggered()), this, SLOT(saveMindMap()));
    // exit action
    _exitAction = new QAction(tr("Exit"), this);
    _exitAction->setIcon(QIcon("Resources\\delete.png"));
    _exitAction->setStatusTip(tr("Exit"));
    connect(_exitAction, SIGNAL(triggered()), this, SLOT(exit()));
    // edit node action
    _editNodeAction = new QAction(tr("& Edit"), this);
    _editNodeAction->setIcon(QIcon("Resources\\edit.png"));
    _editNodeAction->setStatusTip(tr("Edit a node"));
    connect(_editNodeAction, SIGNAL(triggered()), this, SLOT(editNode()));
    // delete node action
    _deleteNodeAction = new QAction(tr("& Delete"), this);
    _deleteNodeAction->setIcon(QIcon("Resources\\delete.png"));
    _deleteNodeAction->setStatusTip(tr("Delete a node"));
    connect(_deleteNodeAction, SIGNAL(triggered()), this, SLOT(deleteNode()));
    // insert child action
    _insertChildAction = new QAction(tr("Insert a& Child"), this);
    _insertChildAction->setIcon(QIcon("Resources\\insertChild.png"));
    _insertChildAction->setStatusTip(tr("Insert a child"));
    connect(_insertChildAction, SIGNAL(triggered()), this, SLOT(insertChild()));
    // insert sibling action
    _insertSiblingAction = new QAction(tr("Insert a& Sibling"), this);
    _insertSiblingAction->setIcon(QIcon("Resources\\insertSibling.png"));
    _insertSiblingAction->setStatusTip(tr("Insert a sibling"));
    connect(_insertSiblingAction, SIGNAL(triggered()), this, SLOT(insertSibling()));
    // insert parent action
    _insertParentAction = new QAction(tr("Insert a& Parent"), this);
    _insertParentAction->setIcon(QIcon("Resources\\insertParent.png"));
    _insertParentAction->setStatusTip(tr("Insert a parent"));
    connect(_insertParentAction, SIGNAL(triggered()), this, SLOT(insertParent()));
    // cut action
    _cutAction = new QAction(tr("Cut"), this);
    _cutAction->setIcon(QIcon("Resources\\cut.png"));
    _cutAction->setStatusTip(tr("Cut"));
    connect(_cutAction, SIGNAL(triggered()), this, SLOT(cut()));
    // copy action
    _copyAction = new QAction(tr("Copy"), this);
    _copyAction->setIcon(QIcon("Resources\\copy.png"));
    _copyAction->setStatusTip(tr("Copy"));
    connect(_copyAction, SIGNAL(triggered()), this, SLOT(copy()));
    // paste action
    _pasteAction = new QAction(tr("Paste"), this);
    _pasteAction->setIcon(QIcon("Resources\\paste.png"));
    _pasteAction->setStatusTip(tr("Paste"));
    connect(_pasteAction, SIGNAL(triggered()), this, SLOT(paste()));
    // about action
    _aboutAction = new QAction("About", this);
    connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about()));
    // undo action
    _undoAction = new QAction(tr("Undo"), this);
    _undoAction->setIcon(QIcon("Resources\\undo.png"));
    _undoAction->setStatusTip(tr("Undo"));
    connect(_undoAction, SIGNAL(triggered()), this, SLOT(undo()));
    // redo action
    _redoAction = new QAction(tr("Redo"), this);
    _redoAction->setIcon(QIcon("Resources\\redo.png"));
    _redoAction->setStatusTip(tr("Redo"));
    connect(_redoAction, SIGNAL(triggered()), this, SLOT(redo()));
    // add rectangle action
    _rectangleStyleAction = new QAction(tr("Rectangle Style"), this);
    _rectangleStyleAction->setIcon(QIcon("Resources\\rectangle.png"));
    _rectangleStyleAction->setStatusTip(tr("Rectangle Style"));
    connect(_rectangleStyleAction, SIGNAL(triggered()), this, SLOT(addRectangleStyle()));
    // add triangle action
    _triangleStyleAction = new QAction(tr("Triangle Style"), this);
    _triangleStyleAction->setIcon(QIcon("Resources\\triangle.png"));
    _triangleStyleAction->setStatusTip(tr("Triangle Style"));
    connect(_triangleStyleAction, SIGNAL(triggered()), this, SLOT(addTriangleStyle()));
    // add ellipse action
    _ellipseStyleAction = new QAction(tr("Ellipse Style"), this);
    _ellipseStyleAction->setIcon(QIcon("Resources\\ellipse.png"));
    _ellipseStyleAction->setStatusTip(tr("Ellipse Style"));
    connect(_ellipseStyleAction, SIGNAL(triggered()), this, SLOT(addEllipseStyle()));
    // toggle collapse action
    _toggleCollapseAction = new QAction(tr("Toggle Collapse"), this);
    _toggleCollapseAction->setIcon(QIcon("Resources\\collapse.png"));
    _toggleCollapseAction->setStatusTip(tr("Toggle Collapse"));
    connect(_toggleCollapseAction, SIGNAL(triggered()), this, SLOT(toggleCollapse()));
}
Пример #3
0
void MindMapWindow::doubleClick()
{
    editNode();
}