From 44450715339fbc31774cf04c1402c199be263a4b Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 6 Feb 2014 17:21:37 +0200 Subject: [PATCH] Move scene to new base point after creation. --HG-- branch : develop --- src/mainwindow.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2a3c3b78a..f7db503b1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -207,14 +207,7 @@ void MainWindow::ActionNewDraw() disconnect(comboBoxDraws, static_cast(&QComboBox::currentIndexChanged), this, &MainWindow::currentDrawChanged); comboBoxDraws->addItem(nameDraw); - index = comboBoxDraws->findText(nameDraw); - if ( index != -1 ) - { // -1 for not found - comboBoxDraws->setCurrentIndex(index); - currentDrawChanged( index ); - } - connect(comboBoxDraws, static_cast(&QComboBox::currentIndexChanged), this, - &MainWindow::currentDrawChanged); + pattern->ClearGObjects(); //Create single point qint64 id = pattern->AddGObject(new VPointF(toPixel((10+comboBoxDraws->count()*5)), toPixel(10), "А", 5, 10)); @@ -228,6 +221,15 @@ void MainWindow::ActionNewDraw() SetEnableTool(true); SetEnableWidgets(true); changeInFile = true; + + index = comboBoxDraws->findText(nameDraw); + if ( index != -1 ) + { // -1 for not found + comboBoxDraws->setCurrentIndex(index); + currentDrawChanged( index ); + } + connect(comboBoxDraws, static_cast(&QComboBox::currentIndexChanged), this, + &MainWindow::currentDrawChanged); } void MainWindow::OptionDraw()