move subtree with mouse bugfix, export action available when scene is closed bugfix

master
Denes Matetelki 14 years ago
parent a2ac1feb6c
commit a76bad0e5a

@ -13,7 +13,6 @@
#include "math.h"
#include "mainwindow.h"
//const QColor GraphWidget::m_paper(255,255,105);
const QColor GraphWidget::m_paper(255,255,153);
@ -26,7 +25,6 @@ GraphWidget::GraphWidget(MainWindow *parent) :
m_editingNode(false),
m_edgeAdding(false),
m_edgeDeleting(false),
// m_edgeColoring(false),
m_contentChanged(false)
{
m_scene = new QGraphicsScene(this);
@ -247,7 +245,7 @@ void GraphWidget::keyPressEvent(QKeyEvent *event)
if (event->modifiers() & Qt::ControlModifier)
{
if (event->modifiers() & Qt::MetaModifier)
if (event->modifiers() & Qt::ShiftModifier)
{
QList <Node *> nodeList = m_activeNode->subtree();
foreach(Node *node, nodeList)
@ -707,7 +705,8 @@ void GraphWidget::nodeSelected(Node *node)
void GraphWidget::nodeMoved(QGraphicsSceneMouseEvent *event)
{
QList <Node *> nodeList;
if (event->modifiers() & Qt::MetaModifier)
if (event->modifiers() & Qt::ControlModifier &&
event->modifiers() & Qt::ShiftModifier)
{
nodeList = m_activeNode->subtree();
}

@ -186,6 +186,7 @@ void MainWindow::newFile()
m_ui->actionSave->setEnabled(false);
m_ui->actionSaveAs->setEnabled(true);
m_ui->actionClose->setEnabled(true);
m_ui->actionExport->setEnabled(true);
contentChanged(false);
m_fileName = "untitled";
setTitle(m_fileName);
@ -228,6 +229,7 @@ void MainWindow::openFile(const QString &fileName)
m_ui->actionSave->setEnabled(true);
m_ui->actionSaveAs->setEnabled(true);
m_ui->actionClose->setEnabled(true);
m_ui->actionExport->setEnabled(true);
contentChanged(false);
setTitle(m_fileName);
showMainToolbar();
@ -301,6 +303,7 @@ bool MainWindow::closeFile()
m_ui->actionSave->setEnabled(false);
m_ui->actionSaveAs->setEnabled(false);
m_ui->actionClose->setEnabled(false);
m_ui->actionExport->setEnabled(false);
m_contentChanged = false;
setTitle("");
m_graphicsView->closeScene();
@ -470,6 +473,7 @@ void MainWindow::closeEvent(QCloseEvent * event)
void MainWindow::keyPressEvent(QKeyEvent *event)
{
// incative action does not listen to signals
if (event->modifiers() & Qt::ControlModifier)
{
if (event->key() == Qt::Key_M)

@ -134,6 +134,9 @@
</property>
</action>
<action name="actionExport">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>E&amp;xport</string>
</property>

Loading…
Cancel
Save