From a76bad0e5a061305caed69ad2a3e27a1ddc78f57 Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Fri, 24 Jun 2011 13:32:42 +0200 Subject: [PATCH] move subtree with mouse bugfix, export action available when scene is closed bugfix --- graphwidget.cpp | 7 +++---- mainwindow.cpp | 4 ++++ mainwindow.ui | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/graphwidget.cpp b/graphwidget.cpp index 307cf82..55c3507 100644 --- a/graphwidget.cpp +++ b/graphwidget.cpp @@ -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 nodeList = m_activeNode->subtree(); foreach(Node *node, nodeList) @@ -707,7 +705,8 @@ void GraphWidget::nodeSelected(Node *node) void GraphWidget::nodeMoved(QGraphicsSceneMouseEvent *event) { QList nodeList; - if (event->modifiers() & Qt::MetaModifier) + if (event->modifiers() & Qt::ControlModifier && + event->modifiers() & Qt::ShiftModifier) { nodeList = m_activeNode->subtree(); } diff --git a/mainwindow.cpp b/mainwindow.cpp index 57710f7..c5fb2c2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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) diff --git a/mainwindow.ui b/mainwindow.ui index f0fea10..9fea0ac 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -134,6 +134,9 @@ + + false + E&xport