diff --git a/src/app/puzzle/share/resources/puzzleicon.qrc b/src/app/puzzle/share/resources/puzzleicon.qrc
index cf7527f52..33d297039 100644
--- a/src/app/puzzle/share/resources/puzzleicon.qrc
+++ b/src/app/puzzle/share/resources/puzzleicon.qrc
@@ -16,5 +16,13 @@
puzzleicon/16x16/roll.png
puzzleicon/16x16/template.png
puzzleicon/svg/cursor_rotate.svg
+ puzzleicon/svg/icon_rotate_90_anticlockwise.svg
+ puzzleicon/svg/icon_rotate_90_clockwise.svg
+ puzzleicon/64x64/iconRotate90Anticlockwise.png
+ puzzleicon/64x64/iconRotate90Clockwise.png
+ puzzleicon/64x64/iconRotateGrainlineHorizontal.png
+ puzzleicon/64x64/iconRotateGrainlineVertical.png
+ puzzleicon/svg/icon_rotate_grainline_horizontal.svg
+ puzzleicon/svg/icon_rotate_grainline_vertical.svg
diff --git a/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotate90Anticlockwise.png b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotate90Anticlockwise.png
new file mode 100644
index 000000000..278265d82
Binary files /dev/null and b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotate90Anticlockwise.png differ
diff --git a/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotate90Clockwise.png b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotate90Clockwise.png
new file mode 100644
index 000000000..9e6907d73
Binary files /dev/null and b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotate90Clockwise.png differ
diff --git a/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineHorizontal.png b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineHorizontal.png
new file mode 100644
index 000000000..910e3766a
Binary files /dev/null and b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineHorizontal.png differ
diff --git a/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineHorizontal@2x.png b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineHorizontal@2x.png
new file mode 100644
index 000000000..f02832cd4
Binary files /dev/null and b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineHorizontal@2x.png differ
diff --git a/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineVertical.png b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineVertical.png
new file mode 100644
index 000000000..74d62e60d
Binary files /dev/null and b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineVertical.png differ
diff --git a/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineVertical@2x.png b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineVertical@2x.png
new file mode 100644
index 000000000..e4af4320d
Binary files /dev/null and b/src/app/puzzle/share/resources/puzzleicon/64x64/iconRotateGrainlineVertical@2x.png differ
diff --git a/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_90_anticlockwise.svg b/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_90_anticlockwise.svg
new file mode 100644
index 000000000..47851199d
--- /dev/null
+++ b/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_90_anticlockwise.svg
@@ -0,0 +1,79 @@
+
+
diff --git a/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_90_clockwise.svg b/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_90_clockwise.svg
new file mode 100644
index 000000000..d2effc39a
--- /dev/null
+++ b/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_90_clockwise.svg
@@ -0,0 +1,79 @@
+
+
diff --git a/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_grainline_horizontal.svg b/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_grainline_horizontal.svg
new file mode 100644
index 000000000..4509e66c8
--- /dev/null
+++ b/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_grainline_horizontal.svg
@@ -0,0 +1,77 @@
+
+
diff --git a/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_grainline_vertical.svg b/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_grainline_vertical.svg
new file mode 100644
index 000000000..34e32c7a7
--- /dev/null
+++ b/src/app/puzzle/share/resources/puzzleicon/svg/icon_rotate_grainline_vertical.svg
@@ -0,0 +1,77 @@
+
+
diff --git a/src/app/puzzle/vpgraphicssheet.cpp b/src/app/puzzle/vpgraphicssheet.cpp
index 5c9638faf..4734e7e47 100644
--- a/src/app/puzzle/vpgraphicssheet.cpp
+++ b/src/app/puzzle/vpgraphicssheet.cpp
@@ -57,6 +57,8 @@ void VPGraphicsSheet::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
painter->setPen(pen);
painter->setBrush(noBrush);
+ QRectF sheetRect = GetSheetRect();
+
if(m_showMargin)
{
painter->drawRect(GetMarginsRect());
@@ -67,10 +69,41 @@ void VPGraphicsSheet::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
pen.setColor(Qt::black);
painter->setPen(pen);
- painter->drawRect(GetSheetRect());
+ painter->drawRect(sheetRect);
}
- m_boundingRect = GetSheetRect();
+ if(m_sheet->GetShowGrid())
+ {
+ pen.setColor(QColor(204,204,204));
+ painter->setPen(pen);
+
+ qreal colWidth = m_sheet->GetGridColWidth();
+ if(colWidth > 0)
+ {
+ qreal colX = colWidth;
+ while (colX < sheetRect.right())
+ {
+ QLineF line = QLineF(colX, 0, colX, sheetRect.bottom());
+ painter->drawLine(line);
+ colX += colWidth;
+ }
+ }
+
+ qreal rowHeight = m_sheet->GetGridRowHeight();
+ if(rowHeight > 0)
+ {
+ qreal rowY = rowHeight;
+
+ while (rowY < sheetRect.bottom())
+ {
+ QLineF line = QLineF(0, rowY, sheetRect.right(), rowY);
+ painter->drawLine(line);
+ rowY += rowHeight;
+ }
+ }
+ }
+
+ m_boundingRect = sheetRect;
}
//---------------------------------------------------------------------------------------------------------------------
@@ -116,7 +149,6 @@ void VPGraphicsSheet::SetShowBorder(bool value)
m_showBorder = value;
}
-
//---------------------------------------------------------------------------------------------------------------------
QRectF VPGraphicsSheet::boundingRect() const
{
diff --git a/src/app/puzzle/vpgraphicssheet.h b/src/app/puzzle/vpgraphicssheet.h
index 0cbef3a41..29e31bf34 100644
--- a/src/app/puzzle/vpgraphicssheet.h
+++ b/src/app/puzzle/vpgraphicssheet.h
@@ -48,19 +48,17 @@ public:
QRectF GetMarginsRect() const;
/**
- * @brief ShowMargin Sets Wether we see the margin
+ * @brief SetShowMargin Sets Wether we see the margin
* @param value true to show the margin
*/
void SetShowMargin(bool value);
/**
- * @brief ShowBorder Sets whether we see the border of the sheet
+ * @brief SetShowBorder Sets whether we see the border of the sheet
* @param value true to show the border
*/
void SetShowBorder(bool value);
-
-
private:
Q_DISABLE_COPY(VPGraphicsSheet)
diff --git a/src/app/puzzle/vpmaingraphicsview.cpp b/src/app/puzzle/vpmaingraphicsview.cpp
index 17a246d96..94cdcdb81 100644
--- a/src/app/puzzle/vpmaingraphicsview.cpp
+++ b/src/app/puzzle/vpmaingraphicsview.cpp
@@ -95,6 +95,9 @@ void VPMainGraphicsView::PrepareForExport()
m_graphicsSheet->SetShowBorder(false);
m_graphicsSheet->SetShowMargin(false);
+ m_showGridTmp = m_layout->GetFocusedSheet()->GetShowGrid();
+ m_layout->GetFocusedSheet()->SetShowGrid(false);
+
m_showTilesTmp = m_layout->GetShowTiles();
m_layout->SetShowTiles(false);
@@ -107,6 +110,8 @@ void VPMainGraphicsView::CleanAfterExport()
m_graphicsSheet->SetShowBorder(true);
m_graphicsSheet->SetShowMargin(true);
+ m_layout->GetFocusedSheet()->SetShowGrid(m_showGridTmp);
+
m_layout->SetShowTiles(m_showTilesTmp);
RefreshLayout();
diff --git a/src/app/puzzle/vpmaingraphicsview.h b/src/app/puzzle/vpmaingraphicsview.h
index b1c84bc90..f1cef49b0 100644
--- a/src/app/puzzle/vpmaingraphicsview.h
+++ b/src/app/puzzle/vpmaingraphicsview.h
@@ -112,6 +112,11 @@ private:
*/
bool m_showTilesTmp{false};
+ /**
+ * variable to hold temporarly hte value of the show grid
+ */
+ bool m_showGridTmp{false};
+
};
#endif // VPMAINGRAPHICSVIEW_H
diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp
index 6a6efa726..19e6e7592 100644
--- a/src/app/puzzle/vpmainwindow.cpp
+++ b/src/app/puzzle/vpmainwindow.cpp
@@ -82,7 +82,7 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) :
m_layout->SetTilesSizeConverted(21,29.7);
m_layout->SetTilesOrientation(PageOrientation::Portrait);
m_layout->SetTilesMarginsConverted(1,1,1,1);
- m_layout->SetShowTiles(true);
+// m_layout->SetShowTiles(true);
// --------------------------------------------------------
@@ -1150,6 +1150,27 @@ void VPMainWindow::on_SheetMarginChanged()
m_graphicsView->RefreshLayout();
}
+//---------------------------------------------------------------------------------------------------------------------
+void VPMainWindow::on_checkBoxSheetShowGrid_toggled(bool checked)
+{
+ m_layout->GetFocusedSheet()->SetShowGrid(checked);
+ m_graphicsView->RefreshLayout();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPMainWindow::on_doubleSpinBoxSheetGridColWidth_valueChanged(double value)
+{
+ m_layout->GetFocusedSheet()->SetGridColWidthConverted(value);
+ m_graphicsView->RefreshLayout();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPMainWindow::on_doubleSpinBoxSheetGridRowHeight_valueChanged(double value)
+{
+ m_layout->GetFocusedSheet()->SetGridRowHeightConverted(value);
+ m_graphicsView->RefreshLayout();
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VPMainWindow::on_comboBoxTilesTemplate_currentIndexChanged(int index)
{
@@ -1376,6 +1397,42 @@ void VPMainWindow::on_checkBoxCurrentPieceMirrorPiece_toggled(bool checked)
}
}
+//---------------------------------------------------------------------------------------------------------------------
+void VPMainWindow::on_pushButtonCurrentPieceRotate90Anticlockwise_clicked()
+{
+ if(m_selectedPieces.count() == 1)
+ {
+ m_selectedPieces.first()->RotateBy(90);
+ }
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPMainWindow::on_pushButtonCurrentPieceRotate90Clockwise_clicked()
+{
+ if(m_selectedPieces.count() == 1)
+ {
+ m_selectedPieces.first()->RotateBy(-90);
+ }
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPMainWindow::on_pushButtonCurrentPieceRotateGrainlineVertical_clicked()
+{
+ if(m_selectedPieces.count() == 1)
+ {
+ m_selectedPieces.first()->RotateToGrainline(90, true);
+ }
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPMainWindow::on_pushButtonCurrentPieceRotateGrainlineHorizontal_clicked()
+{
+ if(m_selectedPieces.count() == 1)
+ {
+ m_selectedPieces.first()->RotateToGrainline(0, true);
+ }
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VPMainWindow::on_doubleSpinBoxCurrentPieceAngle_valueChanged(double value)
{
diff --git a/src/app/puzzle/vpmainwindow.h b/src/app/puzzle/vpmainwindow.h
index aaf5bd0c0..f6c9bb01a 100644
--- a/src/app/puzzle/vpmainwindow.h
+++ b/src/app/puzzle/vpmainwindow.h
@@ -326,6 +326,29 @@ private slots:
*/
void on_SheetMarginChanged();
+ /**
+ * @brief on_checkBoxSheetShowGrid_toggled When the checkbox "show grid" is
+ * clicked
+ * @param checked
+ */
+ void on_checkBoxSheetShowGrid_toggled(bool checked);
+
+ /**
+ * @brief on_doubleSpinBoxSheetGridColWidth_valueChanged When the "grid placement
+ * column width" value is changed in the layout property tab.
+ * The slot is automatically connected through name convention.
+ * @param value the new value of the grid placement column width
+ */
+ void on_doubleSpinBoxSheetGridColWidth_valueChanged(double value);
+
+ /**
+ * @brief on_doubleSpinBoxSheetGridRowHeight_valueChanged When the "grid placement
+ * row height" value is changed in the layout property tab.
+ * The slot is automatically connected through name convention.
+ * @param value the new value of the grid placement row height
+ */
+ void on_doubleSpinBoxSheetGridRowHeight_valueChanged(double value);
+
/**
* @brief LayoutFollowGrainlineChanged When one of the radio boxes for the
* "Follow grainline" has been clicked in the sheet property tab.
@@ -370,7 +393,7 @@ private slots:
/**
* @brief on_checkBoxTilesShowTiles_toggled When the checkbox "show tiles" is
* clicked
- * @param checked´
+ * @param checked
*/
void on_checkBoxTilesShowTiles_toggled(bool checked);
@@ -428,6 +451,30 @@ private slots:
*/
void on_checkBoxCurrentPieceMirrorPiece_toggled(bool checked);
+ /**
+ * @brief on_pushButtonCurrentPieceRotate90Antilockwise_clicked When the 90
+ * anticlockwise angle button is clicked
+ */
+ void on_pushButtonCurrentPieceRotate90Anticlockwise_clicked();
+
+ /**
+ * @brief on_pushButtonCurrentPieceRotate90Clockwise_clicked When the 90
+ * clockwise angle button is clicked
+ */
+ void on_pushButtonCurrentPieceRotate90Clockwise_clicked();
+
+ /**
+ * @brief on_pushButtonCurrentPieceRotateGrainlineVertical_clicked
+ * When the grainline vertical angle button is clicked
+ */
+ void on_pushButtonCurrentPieceRotateGrainlineVertical_clicked();
+
+ /**
+ * @brief on_pushButtonCurrentPieceRotateGrainlineHorizontal_clicked
+ * When the grainline horizontal angle button is clicked
+ */
+ void on_pushButtonCurrentPieceRotateGrainlineHorizontal_clicked();
+
/**
* @brief on_doubleSpinBoxCurrentPieceAngle_valueChanged When the
* "Current Piece Angle" value in the current piece property is changed
diff --git a/src/app/puzzle/vpmainwindow.ui b/src/app/puzzle/vpmainwindow.ui
index 7d73aa8d2..fd9e9a7d7 100644
--- a/src/app/puzzle/vpmainwindow.ui
+++ b/src/app/puzzle/vpmainwindow.ui
@@ -17,6 +17,9 @@
:/puzzleicon/64x64/logo.png:/puzzleicon/64x64/logo.png
+
+ Qt::LeftToRight
+
true
@@ -176,7 +179,7 @@
QTabWidget::Rounded
- 1
+ 0
@@ -234,7 +237,7 @@
0
0
342
- 1318
+ 1370
@@ -359,14 +362,14 @@
Rotation
- -
+
-
Angle:
- -
+
-
360.000000000000000
@@ -376,6 +379,90 @@
+ -
+
+
-
+
+
+ Rotate the piece by 90° clockwise
+
+
+
+
+
+
+ :/puzzleicon/64x64/iconRotate90Clockwise.png:/puzzleicon/64x64/iconRotate90Clockwise.png
+
+
+
+ 32
+ 32
+
+
+
+
+ -
+
+
+ Rotate the piece by 90° anti-clockwise
+
+
+
+
+
+
+ :/puzzleicon/64x64/iconRotate90Anticlockwise.png:/puzzleicon/64x64/iconRotate90Anticlockwise.png
+
+
+
+ 32
+ 32
+
+
+
+
+ -
+
+
+ Rotate the piece so that the grainline is vertical
+
+
+
+
+
+
+ :/puzzleicon/64x64/iconRotateGrainlineVertical.png:/puzzleicon/64x64/iconRotateGrainlineVertical.png
+
+
+
+ 32
+ 32
+
+
+
+
+ -
+
+
+ Rotate the piece so that the grainline is horizontal
+
+
+
+
+
+
+ :/puzzleicon/64x64/iconRotateGrainlineHorizontal.png:/puzzleicon/64x64/iconRotateGrainlineHorizontal.png
+
+
+
+ 32
+ 32
+
+
+
+
+
+
@@ -565,7 +652,7 @@
0
0
342
- 731
+ 870
@@ -803,6 +890,49 @@
+ -
+
+
+ Placement Grid
+
+
+
-
+
+
-
+
+
+ Qt::LeftToRight
+
+
+ Show Grid
+
+
+
+ -
+
+
+ Column width
+
+
+
+ -
+
+
+ -
+
+
+ Row height
+
+
+
+ -
+
+
+
+
+
+
+
-
diff --git a/src/app/puzzle/vppiece.cpp b/src/app/puzzle/vppiece.cpp
index 4ae030063..cb46ed570 100644
--- a/src/app/puzzle/vppiece.cpp
+++ b/src/app/puzzle/vppiece.cpp
@@ -136,6 +136,31 @@ void VPPiece::SetRotation(qreal angle)
}
}
+//---------------------------------------------------------------------------------------------------------------------
+void VPPiece::RotateBy(qreal angle)
+{
+ SetRotation(m_pieceAngle + angle);
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPPiece::RotateToGrainline(qreal angleOfGrainline, bool add180IfAlreadyInPosition)
+{
+ qreal newAngle = -GrainlineAngle() + angleOfGrainline;
+ if(newAngle < 0)
+ {
+ newAngle += 360;
+ }
+
+ if(not VFuzzyComparePossibleNulls(m_pieceAngle, newAngle))
+ {
+ SetRotation(newAngle);
+ }
+ else if(add180IfAlreadyInPosition)
+ {
+ newAngle += 180;
+ SetRotation(newAngle);
+ }
+}
//---------------------------------------------------------------------------------------------------------------------
qreal VPPiece::GetRotation()
diff --git a/src/app/puzzle/vppiece.h b/src/app/puzzle/vppiece.h
index 4e88434ae..f14148f18 100644
--- a/src/app/puzzle/vppiece.h
+++ b/src/app/puzzle/vppiece.h
@@ -95,6 +95,23 @@ public:
*/
qreal GetRotation();
+ /**
+ * @brief rotateBy adds the given angle to the current rotation (anti-clockwise)
+ * @param angle the angle to add
+ */
+ void RotateBy(qreal angle);
+
+ /**
+ * @brief RotateToGrainline rotates the piece, so that the grainline has
+ * the given angle
+ *
+ * @param angleOfGrainline
+ * @param add180IfAlreadyInPosition, automatically adds 180, if the piece is
+ * already in the grainline position
+ */
+ void RotateToGrainline(qreal angleOfGrainline, bool add180IfAlreadyInPosition = false);
+
+
/**
* @brief SetIsSelected Sets wether the piece is selected
* @param value true if the piece is selected
@@ -153,7 +170,6 @@ private:
QVector m_grainline{QVector()};
bool m_isGrainlineEnabled{false};
- qreal m_grainlineAngle{0};
// for now separate the position of the piece to the matrix coming from vlayoutpiece
// because it's difficult to have the origin of the piece by (0,0)
diff --git a/src/app/puzzle/vpsheet.cpp b/src/app/puzzle/vpsheet.cpp
index 96796a0c1..15ca24b27 100644
--- a/src/app/puzzle/vpsheet.cpp
+++ b/src/app/puzzle/vpsheet.cpp
@@ -467,3 +467,64 @@ void VPSheet::ClearSelection()
{
m_pieceList->ClearSelection();
}
+
+
+//---------------------------------------------------------------------------------------------------------------------
+bool VPSheet::GetShowGrid()
+{
+ return m_showGrid;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPSheet::SetShowGrid(bool value)
+{
+ m_showGrid = value;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+qreal VPSheet::GetGridColWidth() const
+{
+ return m_gridColWidth;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+qreal VPSheet::GetGridColWidthConverted() const
+{
+ return UnitConvertor(m_gridColWidth, Unit::Px, m_layout->GetUnit());
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPSheet::SetGridColWidth(qreal value)
+{
+ m_gridColWidth = value;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPSheet::SetGridColWidthConverted(qreal value)
+{
+ m_gridColWidth = UnitConvertor(value, m_layout->GetUnit(), Unit::Px);
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+qreal VPSheet::GetGridRowHeight() const
+{
+ return m_gridRowHeight;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+qreal VPSheet::GetGridRowHeightConverted() const
+{
+ return UnitConvertor(m_gridRowHeight, Unit::Px, m_layout->GetUnit());
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPSheet::SetGridRowHeight(qreal value)
+{
+ m_gridRowHeight = value;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPSheet::SetGridRowHeightConverted(qreal value)
+{
+ m_gridRowHeight = UnitConvertor(value, m_layout->GetUnit(), Unit::Px);
+}
diff --git a/src/app/puzzle/vpsheet.h b/src/app/puzzle/vpsheet.h
index 39fa05268..f1423dcab 100644
--- a/src/app/puzzle/vpsheet.h
+++ b/src/app/puzzle/vpsheet.h
@@ -268,6 +268,70 @@ public:
*/
void ClearSelection();
+ /**
+ * @brief GetShowGrid Returns true if the placement grid has to be shown on the current sheet
+ * @return
+ */
+ bool GetShowGrid();
+
+ /**
+ * @brief SetShowGrid Returns true if the placement grid has to be shown on the current sheet
+ * @param value whether to show the grid or not
+ */
+ void SetShowGrid(bool value);
+
+ /**
+ * @brief GetGridColWidth returns the placement grid column width in Unit::Px
+ * @return the placement grid column width in Unit::Px
+ */
+ qreal GetGridColWidth() const;
+
+ /**
+ * @brief GetGridColWidth returns the placement grid column width in the layout's unit
+ * @return the placement grid column width in the layout's unit
+ */
+ qreal GetGridColWidthConverted() const;
+
+ /**
+ * @brief SetGridColWidth sets the placement grid column width to the given value, the unit has to be Unit::Px
+ * @param value the placement grid column width in Unit::Px
+ */
+ void SetGridColWidth(qreal value);
+
+ /**
+ * @brief SetGridColWidthConverted sets the placement grid column width to the given value, the unit has to be in the layout's unit
+ * @param value the placement grid column width in the layout's unit
+ */
+ void SetGridColWidthConverted(qreal value);
+
+ /**
+ * @brief GetGridRowHeight returns the placement grid row height in Unit::Px
+ * @return the placement grid row height in Unit::Px
+ */
+ qreal GetGridRowHeight() const;
+
+ /**
+ * @brief GetGridRowHeightConverted returns the placement grid row height in the layout's unit
+ * @return the placement grid row height in the layout's unit
+ */
+ qreal GetGridRowHeightConverted() const;
+
+ /**
+ * @brief SetGridRowHeight sets the placement grid row height to the given value, the unit has to be Unit::Px
+ * @param value the placement grid row height in Unit::Px
+ */
+ void SetGridRowHeight(qreal value);
+
+ /**
+ * @brief SetGridRowHeightConverted sets the placement grid row height to the given value, the unit has to be in the layout's unit
+ * @param value the placement grid row height in the layout's unit
+ */
+ void SetGridRowHeightConverted(qreal value);
+
+
+
+
+
void SetStickyEdges(bool state);
bool GetStickyEdges() const;
@@ -305,6 +369,21 @@ private:
*/
qreal m_piecesGap{0};
+ // placement grid
+ /**
+ * @brief GetShowGrid Returns true if the placement grid has to be shown on the current sheet
+ */
+ bool m_showGrid{false};
+ /**
+ * @brief m_gridColWidth the column width of the placement grid in Unit::Px
+ */
+ qreal m_gridColWidth{0};
+
+ /**
+ * @brief m_gridRowHeight the row height of the placement grid in Unit::Px
+ */
+ qreal m_gridRowHeight{0};
+
bool m_stickyEdges{false};
};