From 5f607008ac0d5216b0385a35e0124ec56e2eb0f3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 21 May 2021 10:54:58 +0300 Subject: [PATCH] Return to initial concept. --- src/app/puzzle/vpmainwindow.cpp | 33 +++++++++++++++------------------ src/app/puzzle/vpmainwindow.h | 2 +- src/app/puzzle/vpmainwindow.ui | 23 +++++++++++++---------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index d944f3720..82319768a 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -61,8 +61,6 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) : ui(new Ui::VPMainWindow), m_cmd(cmd) { - m_layout = new VPLayout(); - // create a standard sheet auto *sheet = new VPSheet(m_layout); sheet->SetName(QObject::tr("Sheet 1")); @@ -70,19 +68,19 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) : m_layout->SetFocusedSheet(); // // ----- for test purposes, to be removed------------------ -// sheet->SetSheetMarginsConverted(1, 1, 1, 1); -// sheet->SetSheetSizeConverted(84.1, 118.9); -// sheet->SetPiecesGapConverted(1); + sheet->SetSheetMarginsConverted(1, 1, 1, 1); + sheet->SetSheetSizeConverted(84.1, 118.9); + sheet->SetPiecesGapConverted(1); -// m_layout->SetUnit(Unit::Cm); -// m_layout->SetWarningSuperpositionOfPieces(true); -// m_layout->SetTitle(QString("My Test Layout")); -// m_layout->SetDescription(QString("Description of my Layout")); + m_layout->SetUnit(Unit::Cm); + m_layout->SetWarningSuperpositionOfPieces(true); + m_layout->SetTitle(QString("My Test Layout")); + m_layout->SetDescription(QString("Description of my Layout")); -// m_layout->SetTilesSizeConverted(21,29.7); -// m_layout->SetTilesOrientation(PageOrientation::Portrait); -// m_layout->SetTilesMarginsConverted(1,1,1,1); -// m_layout->SetShowTiles(true); + m_layout->SetTilesSizeConverted(21,29.7); + m_layout->SetTilesOrientation(PageOrientation::Portrait); + m_layout->SetTilesMarginsConverted(1,1,1,1); + m_layout->SetShowTiles(true); // -------------------------------------------------------- @@ -212,7 +210,10 @@ void VPMainWindow::ImportRawLayouts(const QStringList &rawLayouts) //--------------------------------------------------------------------------------------------------------------------- void VPMainWindow::InitZoom() { - m_graphicsView->ZoomFitBest(); + if (m_graphicsView != nullptr) + { + m_graphicsView->ZoomFitBest(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -260,7 +261,6 @@ void VPMainWindow::SetupMenu() // Add dock properties action QAction* actionDockWidgetToolOptions = ui->dockWidgetProperties->toggleViewAction(); ui->menuWindows->addAction(actionDockWidgetToolOptions); - } //--------------------------------------------------------------------------------------------------------------------- @@ -421,7 +421,6 @@ void VPMainWindow::InitPropertyTabLayout() void VPMainWindow::InitCarrousel() { m_carrousel = new VPCarrousel(m_layout, ui->dockWidgetCarrousel); - m_carrousel->setDisabled(true); ui->dockWidgetCarrousel->setWidget(m_carrousel); connect(ui->dockWidgetCarrousel, QOverload::of(&QDockWidget::dockLocationChanged), this, @@ -590,7 +589,6 @@ void VPMainWindow::SetPropertyTabLayoutData() void VPMainWindow::InitMainGraphics() { m_graphicsView = new VPMainGraphicsView(m_layout, m_tileFactory, this); - m_graphicsView->setDisabled(true); ui->centralWidget->layout()->addWidget(m_graphicsView); m_graphicsView->RefreshLayout(); @@ -641,7 +639,6 @@ void VPMainWindow::InitZoomToolBar() m_doubleSpinBoxScale = new QDoubleSpinBox(this); m_doubleSpinBoxScale->setDecimals(1); m_doubleSpinBoxScale->setSuffix("%"); - m_doubleSpinBoxScale->setDisabled(true); on_ScaleChanged(m_graphicsView->transform().m11()); connect(m_doubleSpinBoxScale.data(), QOverload::of(&QDoubleSpinBox::valueChanged), this, [this](double d){m_graphicsView->Zoom(d/100.0);}); diff --git a/src/app/puzzle/vpmainwindow.h b/src/app/puzzle/vpmainwindow.h index a26bda72b..9f25b8ae3 100644 --- a/src/app/puzzle/vpmainwindow.h +++ b/src/app/puzzle/vpmainwindow.h @@ -407,7 +407,7 @@ private: VPCommandLinePtr m_cmd; - VPLayout *m_layout{nullptr}; + VPLayout *m_layout{new VPLayout()}; QListm_selectedPieces{QList()}; VPTileFactory *m_tileFactory{nullptr}; diff --git a/src/app/puzzle/vpmainwindow.ui b/src/app/puzzle/vpmainwindow.ui index 418a562cf..468c4b6bc 100644 --- a/src/app/puzzle/vpmainwindow.ui +++ b/src/app/puzzle/vpmainwindow.ui @@ -176,7 +176,7 @@ - false + true @@ -231,6 +231,9 @@ + + true + @@ -1576,7 +1579,7 @@ - false + true @@ -1591,7 +1594,7 @@ - false + true @@ -1606,7 +1609,7 @@ - false + true &Close Layout @@ -1614,7 +1617,7 @@ - false + true &Import Raw Layout Data @@ -1678,7 +1681,7 @@ true - false + true Properties @@ -1689,7 +1692,7 @@ - false + true @@ -1701,7 +1704,7 @@ - false + true @@ -1713,7 +1716,7 @@ - false + true @@ -1725,7 +1728,7 @@ - false + true