Return to initial concept.

This commit is contained in:
Roman Telezhynskyi 2021-05-21 10:54:58 +03:00
parent dc50d24439
commit 5f607008ac
3 changed files with 29 additions and 29 deletions

View File

@ -61,8 +61,6 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) :
ui(new Ui::VPMainWindow), ui(new Ui::VPMainWindow),
m_cmd(cmd) m_cmd(cmd)
{ {
m_layout = new VPLayout();
// create a standard sheet // create a standard sheet
auto *sheet = new VPSheet(m_layout); auto *sheet = new VPSheet(m_layout);
sheet->SetName(QObject::tr("Sheet 1")); sheet->SetName(QObject::tr("Sheet 1"));
@ -70,19 +68,19 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) :
m_layout->SetFocusedSheet(); m_layout->SetFocusedSheet();
// // ----- for test purposes, to be removed------------------ // // ----- for test purposes, to be removed------------------
// sheet->SetSheetMarginsConverted(1, 1, 1, 1); sheet->SetSheetMarginsConverted(1, 1, 1, 1);
// sheet->SetSheetSizeConverted(84.1, 118.9); sheet->SetSheetSizeConverted(84.1, 118.9);
// sheet->SetPiecesGapConverted(1); sheet->SetPiecesGapConverted(1);
// m_layout->SetUnit(Unit::Cm); m_layout->SetUnit(Unit::Cm);
// m_layout->SetWarningSuperpositionOfPieces(true); m_layout->SetWarningSuperpositionOfPieces(true);
// m_layout->SetTitle(QString("My Test Layout")); m_layout->SetTitle(QString("My Test Layout"));
// m_layout->SetDescription(QString("Description of my Layout")); m_layout->SetDescription(QString("Description of my Layout"));
// m_layout->SetTilesSizeConverted(21,29.7); m_layout->SetTilesSizeConverted(21,29.7);
// m_layout->SetTilesOrientation(PageOrientation::Portrait); m_layout->SetTilesOrientation(PageOrientation::Portrait);
// m_layout->SetTilesMarginsConverted(1,1,1,1); m_layout->SetTilesMarginsConverted(1,1,1,1);
// m_layout->SetShowTiles(true); m_layout->SetShowTiles(true);
// -------------------------------------------------------- // --------------------------------------------------------
@ -212,7 +210,10 @@ void VPMainWindow::ImportRawLayouts(const QStringList &rawLayouts)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPMainWindow::InitZoom() void VPMainWindow::InitZoom()
{ {
m_graphicsView->ZoomFitBest(); if (m_graphicsView != nullptr)
{
m_graphicsView->ZoomFitBest();
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -260,7 +261,6 @@ void VPMainWindow::SetupMenu()
// Add dock properties action // Add dock properties action
QAction* actionDockWidgetToolOptions = ui->dockWidgetProperties->toggleViewAction(); QAction* actionDockWidgetToolOptions = ui->dockWidgetProperties->toggleViewAction();
ui->menuWindows->addAction(actionDockWidgetToolOptions); ui->menuWindows->addAction(actionDockWidgetToolOptions);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -421,7 +421,6 @@ void VPMainWindow::InitPropertyTabLayout()
void VPMainWindow::InitCarrousel() void VPMainWindow::InitCarrousel()
{ {
m_carrousel = new VPCarrousel(m_layout, ui->dockWidgetCarrousel); m_carrousel = new VPCarrousel(m_layout, ui->dockWidgetCarrousel);
m_carrousel->setDisabled(true);
ui->dockWidgetCarrousel->setWidget(m_carrousel); ui->dockWidgetCarrousel->setWidget(m_carrousel);
connect(ui->dockWidgetCarrousel, QOverload<Qt::DockWidgetArea>::of(&QDockWidget::dockLocationChanged), this, connect(ui->dockWidgetCarrousel, QOverload<Qt::DockWidgetArea>::of(&QDockWidget::dockLocationChanged), this,
@ -590,7 +589,6 @@ void VPMainWindow::SetPropertyTabLayoutData()
void VPMainWindow::InitMainGraphics() void VPMainWindow::InitMainGraphics()
{ {
m_graphicsView = new VPMainGraphicsView(m_layout, m_tileFactory, this); m_graphicsView = new VPMainGraphicsView(m_layout, m_tileFactory, this);
m_graphicsView->setDisabled(true);
ui->centralWidget->layout()->addWidget(m_graphicsView); ui->centralWidget->layout()->addWidget(m_graphicsView);
m_graphicsView->RefreshLayout(); m_graphicsView->RefreshLayout();
@ -641,7 +639,6 @@ void VPMainWindow::InitZoomToolBar()
m_doubleSpinBoxScale = new QDoubleSpinBox(this); m_doubleSpinBoxScale = new QDoubleSpinBox(this);
m_doubleSpinBoxScale->setDecimals(1); m_doubleSpinBoxScale->setDecimals(1);
m_doubleSpinBoxScale->setSuffix("%"); m_doubleSpinBoxScale->setSuffix("%");
m_doubleSpinBoxScale->setDisabled(true);
on_ScaleChanged(m_graphicsView->transform().m11()); on_ScaleChanged(m_graphicsView->transform().m11());
connect(m_doubleSpinBoxScale.data(), QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(m_doubleSpinBoxScale.data(), QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, [this](double d){m_graphicsView->Zoom(d/100.0);}); this, [this](double d){m_graphicsView->Zoom(d/100.0);});

View File

@ -407,7 +407,7 @@ private:
VPCommandLinePtr m_cmd; VPCommandLinePtr m_cmd;
VPLayout *m_layout{nullptr}; VPLayout *m_layout{new VPLayout()};
QList<VPPiece *>m_selectedPieces{QList<VPPiece *>()}; QList<VPPiece *>m_selectedPieces{QList<VPPiece *>()};
VPTileFactory *m_tileFactory{nullptr}; VPTileFactory *m_tileFactory{nullptr};

View File

@ -176,7 +176,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidgetProperties"> <widget class="QTabWidget" name="tabWidgetProperties">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
@ -231,6 +231,9 @@
</property> </property>
<item> <item>
<widget class="QScrollArea" name="scrollAreaCurrentPiece"> <widget class="QScrollArea" name="scrollAreaCurrentPiece">
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
</property> </property>
@ -1576,7 +1579,7 @@
</action> </action>
<action name="actionSave"> <action name="actionSave">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="document-save"> <iconset theme="document-save">
@ -1591,7 +1594,7 @@
</action> </action>
<action name="actionSaveAs"> <action name="actionSaveAs">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="document-save-as"> <iconset theme="document-save-as">
@ -1606,7 +1609,7 @@
</action> </action>
<action name="actionCloseLayout"> <action name="actionCloseLayout">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Close Layout</string> <string>&amp;Close Layout</string>
@ -1614,7 +1617,7 @@
</action> </action>
<action name="actionImportRawLayout"> <action name="actionImportRawLayout">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Import Raw Layout Data</string> <string>&amp;Import Raw Layout Data</string>
@ -1678,7 +1681,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Properties</string> <string>Properties</string>
@ -1689,7 +1692,7 @@
</action> </action>
<action name="actionZoomIn"> <action name="actionZoomIn">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="zoom-in"> <iconset theme="zoom-in">
@ -1701,7 +1704,7 @@
</action> </action>
<action name="actionZoomOut"> <action name="actionZoomOut">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="zoom-out"> <iconset theme="zoom-out">
@ -1713,7 +1716,7 @@
</action> </action>
<action name="actionZoomOriginal"> <action name="actionZoomOriginal">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="zoom-original"> <iconset theme="zoom-original">
@ -1725,7 +1728,7 @@
</action> </action>
<action name="actionZoomFitBest"> <action name="actionZoomFitBest">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="zoom-fit-best"> <iconset theme="zoom-fit-best">