From 5e785bfa79a90d1114d013e04af38b655c0354ee Mon Sep 17 00:00:00 2001 From: Ronan Le Tiec Date: Sat, 23 May 2020 15:34:11 +0200 Subject: [PATCH] Refactoring VPuzzleLayout --- src/app/puzzle/puzzle.pri | 4 +- src/app/puzzle/vpcarrousel.cpp | 2 +- src/app/puzzle/vpcarrousel.h | 6 +- src/app/puzzle/vpgraphicspiece.cpp | 2 +- src/app/puzzle/vpgraphicssheet.cpp | 2 +- src/app/puzzle/vpgraphicssheet.h | 6 +- .../{vpuzzlelayout.cpp => vplayout.cpp} | 78 +++++++++---------- .../puzzle/{vpuzzlelayout.h => vplayout.h} | 16 ++-- src/app/puzzle/vpmainwindow.cpp | 4 +- src/app/puzzle/vpmainwindow.h | 4 +- src/app/puzzle/vppiecelist.cpp | 6 +- src/app/puzzle/vppiecelist.h | 8 +- src/app/puzzle/vpuzzlemaingraphicsview.cpp | 4 +- src/app/puzzle/vpuzzlemaingraphicsview.h | 4 +- src/app/puzzle/xml/vplayoutfilereader.cpp | 10 +-- src/app/puzzle/xml/vplayoutfilereader.h | 14 ++-- src/app/puzzle/xml/vplayoutfilewriter.cpp | 12 +-- src/app/puzzle/xml/vplayoutfilewriter.h | 12 +-- 18 files changed, 97 insertions(+), 97 deletions(-) rename src/app/puzzle/{vpuzzlelayout.cpp => vplayout.cpp} (81%) rename src/app/puzzle/{vpuzzlelayout.h => vplayout.h} (97%) diff --git a/src/app/puzzle/puzzle.pri b/src/app/puzzle/puzzle.pri index c94dea9cd..b7442b82a 100644 --- a/src/app/puzzle/puzzle.pri +++ b/src/app/puzzle/puzzle.pri @@ -13,9 +13,9 @@ SOURCES += \ $$PWD/vpcommands.cpp \ $$PWD/vpgraphicspiece.cpp \ $$PWD/vpgraphicssheet.cpp \ + $$PWD/vplayout.cpp \ $$PWD/vpmainwindow.cpp \ $$PWD/vppiecelist.cpp \ - $$PWD/vpuzzlelayout.cpp \ $$PWD/vpuzzlemaingraphicsview.cpp \ $$PWD/vpuzzlemimedatapiece.cpp \ $$PWD/vpuzzlepiece.cpp \ @@ -37,10 +37,10 @@ HEADERS += \ $$PWD/vpcommands.h \ $$PWD/vpgraphicspiece.h \ $$PWD/vpgraphicssheet.h \ + $$PWD/vplayout.h \ $$PWD/vpmainwindow.h \ $$PWD/vppiecelist.h \ $$PWD/vpstable.h \ - $$PWD/vpuzzlelayout.h \ $$PWD/vpuzzlemaingraphicsview.h \ $$PWD/vpuzzlemimedatapiece.h \ $$PWD/vpuzzlepiece.h \ diff --git a/src/app/puzzle/vpcarrousel.cpp b/src/app/puzzle/vpcarrousel.cpp index f3d8df3aa..8573ce873 100644 --- a/src/app/puzzle/vpcarrousel.cpp +++ b/src/app/puzzle/vpcarrousel.cpp @@ -41,7 +41,7 @@ Q_LOGGING_CATEGORY(pCarrousel, "p.carrousel") //--------------------------------------------------------------------------------------------------------------------- -VPCarrousel::VPCarrousel(VPuzzleLayout *layout, QWidget *parent) : +VPCarrousel::VPCarrousel(VPLayout *layout, QWidget *parent) : QWidget(parent), ui(new Ui::VPCarrousel), m_layout(layout) diff --git a/src/app/puzzle/vpcarrousel.h b/src/app/puzzle/vpcarrousel.h index 6e6b72520..e0ca7cfe6 100644 --- a/src/app/puzzle/vpcarrousel.h +++ b/src/app/puzzle/vpcarrousel.h @@ -32,7 +32,7 @@ #include #include #include -#include "vpuzzlelayout.h" +#include "vplayout.h" #include "vpuzzlepiece.h" namespace Ui @@ -44,7 +44,7 @@ class VPCarrousel : public QWidget { Q_OBJECT public: - explicit VPCarrousel(VPuzzleLayout *layout, QWidget *parent = nullptr); + explicit VPCarrousel(VPLayout *layout, QWidget *parent = nullptr); virtual ~VPCarrousel() = default; /** @@ -79,7 +79,7 @@ private: Q_DISABLE_COPY(VPCarrousel) Ui::VPCarrousel *ui; - VPuzzleLayout *m_layout; + VPLayout *m_layout; QList m_pieceLists{}; Qt::Orientation m_orientation{Qt::Vertical}; diff --git a/src/app/puzzle/vpgraphicspiece.cpp b/src/app/puzzle/vpgraphicspiece.cpp index 970e5a1dd..3908ae3e6 100644 --- a/src/app/puzzle/vpgraphicspiece.cpp +++ b/src/app/puzzle/vpgraphicspiece.cpp @@ -41,7 +41,7 @@ #include "vpuzzlepiece.h" #include "vppiecelist.h" -#include "vpuzzlelayout.h" +#include "vplayout.h" #include Q_LOGGING_CATEGORY(pGraphicsPiece, "p.graphicsPiece") diff --git a/src/app/puzzle/vpgraphicssheet.cpp b/src/app/puzzle/vpgraphicssheet.cpp index e8ca73e16..9919679b1 100644 --- a/src/app/puzzle/vpgraphicssheet.cpp +++ b/src/app/puzzle/vpgraphicssheet.cpp @@ -29,7 +29,7 @@ #include "vpgraphicssheet.h" //--------------------------------------------------------------------------------------------------------------------- -VPGraphicsSheet::VPGraphicsSheet(VPuzzleLayout *layout, QGraphicsItem *parent): +VPGraphicsSheet::VPGraphicsSheet(VPLayout *layout, QGraphicsItem *parent): QGraphicsItem(parent), m_layout(layout), m_boundingRect(GetLayoutRect()) diff --git a/src/app/puzzle/vpgraphicssheet.h b/src/app/puzzle/vpgraphicssheet.h index b57d7001c..01183d97c 100644 --- a/src/app/puzzle/vpgraphicssheet.h +++ b/src/app/puzzle/vpgraphicssheet.h @@ -32,12 +32,12 @@ #include #include -#include "vpuzzlelayout.h" +#include "vplayout.h" class VPGraphicsSheet : public QGraphicsItem { public: - explicit VPGraphicsSheet(VPuzzleLayout *layout, QGraphicsItem *parent = nullptr); + explicit VPGraphicsSheet(VPLayout *layout, QGraphicsItem *parent = nullptr); ~VPGraphicsSheet(); QRectF boundingRect() const override; @@ -51,7 +51,7 @@ public: private: Q_DISABLE_COPY(VPGraphicsSheet) - VPuzzleLayout *m_layout{nullptr}; + VPLayout *m_layout{nullptr}; QRectF m_boundingRect; }; diff --git a/src/app/puzzle/vpuzzlelayout.cpp b/src/app/puzzle/vplayout.cpp similarity index 81% rename from src/app/puzzle/vpuzzlelayout.cpp rename to src/app/puzzle/vplayout.cpp index e57daf39f..b823d45c8 100644 --- a/src/app/puzzle/vpuzzlelayout.cpp +++ b/src/app/puzzle/vplayout.cpp @@ -1,6 +1,6 @@ /************************************************************************ ** - ** @file vpuzzlelayout.cpp + ** @file vplayout.cpp ** @author Ronan Le Tiec ** @date 13 4, 2020 ** @@ -25,12 +25,12 @@ ** along with Valentina. If not, see . ** *************************************************************************/ -#include "vpuzzlelayout.h" +#include "vplayout.h" #include "vppiecelist.h" #include "vpuzzlepiece.h" //--------------------------------------------------------------------------------------------------------------------- -VPuzzleLayout::VPuzzleLayout() : +VPLayout::VPLayout() : m_unplacedPieceList(new VPPieceList(this)) { m_unplacedPieceList->SetName(QObject::tr("Unplaced pieces")); @@ -45,20 +45,20 @@ VPuzzleLayout::VPuzzleLayout() : } //--------------------------------------------------------------------------------------------------------------------- -VPuzzleLayout::~VPuzzleLayout() +VPLayout::~VPLayout() { qDeleteAll(m_pieceLists); delete m_unplacedPieceList; } //--------------------------------------------------------------------------------------------------------------------- -VPPieceList* VPuzzleLayout::GetUnplacedPieceList() +VPPieceList* VPLayout::GetUnplacedPieceList() { return m_unplacedPieceList; } //--------------------------------------------------------------------------------------------------------------------- -VPPieceList* VPuzzleLayout::AddPieceList() +VPPieceList* VPLayout::AddPieceList() { VPPieceList *newPieceList = new VPPieceList(this); m_pieceLists.append(newPieceList); @@ -66,20 +66,20 @@ VPPieceList* VPuzzleLayout::AddPieceList() } //--------------------------------------------------------------------------------------------------------------------- -VPPieceList* VPuzzleLayout::AddPieceList(VPPieceList *pieceList) +VPPieceList* VPLayout::AddPieceList(VPPieceList *pieceList) { m_pieceLists.append(pieceList); return pieceList; } //--------------------------------------------------------------------------------------------------------------------- -QList VPuzzleLayout::GetPiecesLists() +QList VPLayout::GetPiecesLists() { return m_pieceLists; } //--------------------------------------------------------------------------------------------------------------------- -QList VPuzzleLayout::GetSelectedPieces() +QList VPLayout::GetSelectedPieces() { QList result = QList(); @@ -102,39 +102,39 @@ QList VPuzzleLayout::GetSelectedPieces() //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetUnit(Unit unit) +void VPLayout::SetUnit(Unit unit) { m_unit = unit; } //--------------------------------------------------------------------------------------------------------------------- -Unit VPuzzleLayout::GetUnit() const +Unit VPLayout::GetUnit() const { return m_unit; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutSize(qreal width, qreal height) +void VPLayout::SetLayoutSize(qreal width, qreal height) { m_size.setWidth(width); m_size.setHeight(height); } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutSizeConverted(qreal width, qreal height) +void VPLayout::SetLayoutSizeConverted(qreal width, qreal height) { m_size.setWidth(UnitConvertor(width, m_unit, Unit::Px)); m_size.setHeight(UnitConvertor(height, m_unit, Unit::Px)); } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutSize(const QSizeF &size) +void VPLayout::SetLayoutSize(const QSizeF &size) { m_size = size; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutSizeConverted(const QSizeF &size) +void VPLayout::SetLayoutSizeConverted(const QSizeF &size) { m_size = QSizeF( UnitConvertor(size.width(), m_unit, Unit::Px), @@ -143,13 +143,13 @@ void VPuzzleLayout::SetLayoutSizeConverted(const QSizeF &size) } //--------------------------------------------------------------------------------------------------------------------- -QSizeF VPuzzleLayout::GetLayoutSize() const +QSizeF VPLayout::GetLayoutSize() const { return m_size; } //--------------------------------------------------------------------------------------------------------------------- -QSizeF VPuzzleLayout::GetLayoutSizeConverted() const +QSizeF VPLayout::GetLayoutSizeConverted() const { QSizeF convertedSize = QSizeF( UnitConvertor(m_size.width(), Unit::Px, m_unit), @@ -160,7 +160,7 @@ QSizeF VPuzzleLayout::GetLayoutSizeConverted() const } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutMargins(qreal left, qreal top, qreal right, qreal bottom) +void VPLayout::SetLayoutMargins(qreal left, qreal top, qreal right, qreal bottom) { m_margins.setLeft(left); m_margins.setTop(top); @@ -168,7 +168,7 @@ void VPuzzleLayout::SetLayoutMargins(qreal left, qreal top, qreal right, qreal b m_margins.setBottom(bottom); } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutMarginsConverted(qreal left, qreal top, qreal right, qreal bottom) +void VPLayout::SetLayoutMarginsConverted(qreal left, qreal top, qreal right, qreal bottom) { m_margins.setLeft(UnitConvertor(left, m_unit, Unit::Px)); m_margins.setTop(UnitConvertor(top, m_unit, Unit::Px)); @@ -177,103 +177,103 @@ void VPuzzleLayout::SetLayoutMarginsConverted(qreal left, qreal top, qreal right } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutMargins(const QMarginsF &margins) +void VPLayout::SetLayoutMargins(const QMarginsF &margins) { m_margins = margins; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutMarginsConverted(const QMarginsF &margins) +void VPLayout::SetLayoutMarginsConverted(const QMarginsF &margins) { m_margins = UnitConvertor(margins, m_unit, Unit::Px); } //--------------------------------------------------------------------------------------------------------------------- -QMarginsF VPuzzleLayout::GetLayoutMargins() const +QMarginsF VPLayout::GetLayoutMargins() const { return m_margins; } //--------------------------------------------------------------------------------------------------------------------- -QMarginsF VPuzzleLayout::GetLayoutMarginsConverted() const +QMarginsF VPLayout::GetLayoutMarginsConverted() const { return UnitConvertor(m_margins, Unit::Px, m_unit); } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetFollowGrainline(FollowGrainline state) +void VPLayout::SetFollowGrainline(FollowGrainline state) { m_followGrainLine = state; } //--------------------------------------------------------------------------------------------------------------------- -FollowGrainline VPuzzleLayout::GetFollowGrainline() const +FollowGrainline VPLayout::GetFollowGrainline() const { return m_followGrainLine; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetPiecesGap(qreal value) +void VPLayout::SetPiecesGap(qreal value) { m_piecesGap = value; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetPiecesGapConverted(qreal value) +void VPLayout::SetPiecesGapConverted(qreal value) { m_piecesGap = UnitConvertor(value, m_unit, Unit::Px); } //--------------------------------------------------------------------------------------------------------------------- -qreal VPuzzleLayout::GetPiecesGap() const +qreal VPLayout::GetPiecesGap() const { return m_piecesGap; } //--------------------------------------------------------------------------------------------------------------------- -qreal VPuzzleLayout::GetPiecesGapConverted() const +qreal VPLayout::GetPiecesGapConverted() const { return UnitConvertor(m_piecesGap, Unit::Px, m_unit); } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetWarningSuperpositionOfPieces(bool state) +void VPLayout::SetWarningSuperpositionOfPieces(bool state) { m_warningSuperpositionOfPieces = state; } //--------------------------------------------------------------------------------------------------------------------- -bool VPuzzleLayout::GetWarningSuperpositionOfPieces() const +bool VPLayout::GetWarningSuperpositionOfPieces() const { return m_warningSuperpositionOfPieces; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetWarningPiecesOutOfBound(bool state) +void VPLayout::SetWarningPiecesOutOfBound(bool state) { m_warningPiecesOutOfBound = state; } //--------------------------------------------------------------------------------------------------------------------- -bool VPuzzleLayout::GetWarningPiecesOutOfBound() const +bool VPLayout::GetWarningPiecesOutOfBound() const { return m_warningPiecesOutOfBound; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetStickyEdges(bool state) +void VPLayout::SetStickyEdges(bool state) { m_stickyEdges = state; } //--------------------------------------------------------------------------------------------------------------------- -bool VPuzzleLayout::GetStickyEdges() const +bool VPLayout::GetStickyEdges() const { return m_stickyEdges; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::ClearSelection() +void VPLayout::ClearSelection() { m_unplacedPieceList->ClearSelection(); @@ -284,7 +284,7 @@ void VPuzzleLayout::ClearSelection() } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetFocusedPieceList(VPPieceList* focusedPieceList) +void VPLayout::SetFocusedPieceList(VPPieceList* focusedPieceList) { if(focusedPieceList == nullptr) { @@ -297,13 +297,13 @@ void VPuzzleLayout::SetFocusedPieceList(VPPieceList* focusedPieceList) } //--------------------------------------------------------------------------------------------------------------------- -VPPieceList* VPuzzleLayout::GetFocusedPieceList() +VPPieceList* VPLayout::GetFocusedPieceList() { return m_focusedPieceList; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::MovePieceToPieceList(VPuzzlePiece* piece, VPPieceList* pieceList) +void VPLayout::MovePieceToPieceList(VPuzzlePiece* piece, VPPieceList* pieceList) { VPPieceList* pieceListBefore = piece->GetPieceList(); diff --git a/src/app/puzzle/vpuzzlelayout.h b/src/app/puzzle/vplayout.h similarity index 97% rename from src/app/puzzle/vpuzzlelayout.h rename to src/app/puzzle/vplayout.h index 33ef12b8e..7c45a29ff 100644 --- a/src/app/puzzle/vpuzzlelayout.h +++ b/src/app/puzzle/vplayout.h @@ -1,6 +1,6 @@ /************************************************************************ ** - ** @file vpuzzlelayout.h + ** @file vplayout.h ** @author Ronan Le Tiec ** @date 13 4, 2020 ** @@ -25,8 +25,8 @@ ** along with Valentina. If not, see . ** *************************************************************************/ -#ifndef VPUZZLELAYOUT_H -#define VPUZZLELAYOUT_H +#ifndef VPLAYOUT_H +#define VPLAYOUT_H #include #include @@ -40,12 +40,12 @@ class VPuzzlePiece; // is this the right place for the definition? enum class FollowGrainline : qint8 { No = 0, Follow90 = 1, Follow180 = 2}; -class VPuzzleLayout : public QObject +class VPLayout : public QObject { Q_OBJECT public: - VPuzzleLayout(); - virtual ~VPuzzleLayout(); + VPLayout(); + virtual ~VPLayout(); /** * @brief GetUnplacedPieceList Returns the piece list of unplaced pieces @@ -231,7 +231,7 @@ signals: void PieceMovedToPieceList(VPuzzlePiece *piece, VPPieceList *pieceListBefore, VPPieceList *pieceListAfter); private: - Q_DISABLE_COPY(VPuzzleLayout) + Q_DISABLE_COPY(VPLayout) VPPieceList *m_unplacedPieceList; QList m_pieceLists{}; @@ -268,4 +268,4 @@ private: }; -#endif // VPUZZLELAYOUT_H +#endif // VPLAYOUT_H diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index db79905f7..39c634f95 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -58,7 +58,7 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) : m_cmd(cmd) { - m_layout = new VPuzzleLayout(); + m_layout = new VPLayout(); // ----- for test purposes, to be removed------------------ m_layout->SetLayoutMarginsConverted(2, 2, 2, 2); @@ -110,7 +110,7 @@ bool VPMainWindow::LoadFile(QString path) if(m_layout == nullptr) { - m_layout = new VPuzzleLayout(); + m_layout = new VPLayout(); } fileReader->ReadFile(m_layout, &file); diff --git a/src/app/puzzle/vpmainwindow.h b/src/app/puzzle/vpmainwindow.h index 1824b960f..7ec2d1ac0 100644 --- a/src/app/puzzle/vpmainwindow.h +++ b/src/app/puzzle/vpmainwindow.h @@ -35,7 +35,7 @@ #include "../vmisc/def.h" #include "vpcarrousel.h" #include "vpuzzlemaingraphicsview.h" -#include "vpuzzlelayout.h" +#include "vplayout.h" #include "vpuzzlepiece.h" #include "../vlayout/vlayoutpiece.h" #include "vpcommandline.h" @@ -95,7 +95,7 @@ private: VPCommandLinePtr m_cmd; - VPuzzleLayout *m_layout{nullptr}; + VPLayout *m_layout{nullptr}; QListm_selectedPieces{QList()}; /** diff --git a/src/app/puzzle/vppiecelist.cpp b/src/app/puzzle/vppiecelist.cpp index ee43ad220..85c25454b 100644 --- a/src/app/puzzle/vppiecelist.cpp +++ b/src/app/puzzle/vppiecelist.cpp @@ -27,14 +27,14 @@ *************************************************************************/ #include "vppiecelist.h" -#include "vpuzzlelayout.h" +#include "vplayout.h" #include Q_LOGGING_CATEGORY(pPieceList, "p.pieceList") //--------------------------------------------------------------------------------------------------------------------- -VPPieceList::VPPieceList(VPuzzleLayout *layout): +VPPieceList::VPPieceList(VPLayout *layout): m_layout(layout) { @@ -47,7 +47,7 @@ VPPieceList::~VPPieceList() } //--------------------------------------------------------------------------------------------------------------------- -VPuzzleLayout* VPPieceList::GetLayout() +VPLayout* VPPieceList::GetLayout() { return m_layout; } diff --git a/src/app/puzzle/vppiecelist.h b/src/app/puzzle/vppiecelist.h index 9c6043f3b..384f1b81f 100644 --- a/src/app/puzzle/vppiecelist.h +++ b/src/app/puzzle/vppiecelist.h @@ -31,13 +31,13 @@ #include #include "vpuzzlepiece.h" -class VPuzzleLayout; +class VPLayout; class VPPieceList : public QObject { Q_OBJECT public: - VPPieceList(VPuzzleLayout *layout); + VPPieceList(VPLayout *layout); ~VPPieceList(); QList GetPieces(); @@ -57,7 +57,7 @@ public: * @brief GetLayout Returns the layout in which this piece list is * @return the layout of this piece list */ - VPuzzleLayout* GetLayout(); + VPLayout* GetLayout(); /** * @brief ClearSelection Clears the selection of the pieces in this piece list @@ -81,7 +81,7 @@ private: QString m_name{}; QList m_pieces{}; - VPuzzleLayout *m_layout{nullptr}; + VPLayout *m_layout{nullptr}; // control bool m_isVisible{true}; diff --git a/src/app/puzzle/vpuzzlemaingraphicsview.cpp b/src/app/puzzle/vpuzzlemaingraphicsview.cpp index 4b1fc57f1..53a80e1e4 100644 --- a/src/app/puzzle/vpuzzlemaingraphicsview.cpp +++ b/src/app/puzzle/vpuzzlemaingraphicsview.cpp @@ -42,7 +42,7 @@ Q_LOGGING_CATEGORY(pMainGraphicsView, "p.mainGraphicsView") //--------------------------------------------------------------------------------------------------------------------- -VPuzzleMainGraphicsView::VPuzzleMainGraphicsView(VPuzzleLayout *layout, QWidget *parent) : +VPuzzleMainGraphicsView::VPuzzleMainGraphicsView(VPLayout *layout, QWidget *parent) : VMainGraphicsView(parent), m_layout(layout) { @@ -56,7 +56,7 @@ VPuzzleMainGraphicsView::VPuzzleMainGraphicsView(VPuzzleLayout *layout, QWidget setAcceptDrops(true); // add the connections - connect(m_layout, &VPuzzleLayout::PieceMovedToPieceList, this, &VPuzzleMainGraphicsView::on_PieceMovedToPieceList); + connect(m_layout, &VPLayout::PieceMovedToPieceList, this, &VPuzzleMainGraphicsView::on_PieceMovedToPieceList); connect(m_scene, &VMainGraphicsScene::selectionChanged, this, &VPuzzleMainGraphicsView::on_SceneSelectionChanged); } diff --git a/src/app/puzzle/vpuzzlemaingraphicsview.h b/src/app/puzzle/vpuzzlemaingraphicsview.h index ce181ec04..7fc605d7c 100644 --- a/src/app/puzzle/vpuzzlemaingraphicsview.h +++ b/src/app/puzzle/vpuzzlemaingraphicsview.h @@ -40,7 +40,7 @@ class VPuzzleMainGraphicsView : public VMainGraphicsView { Q_OBJECT public: - VPuzzleMainGraphicsView(VPuzzleLayout *layout, QWidget *parent); + VPuzzleMainGraphicsView(VPLayout *layout, QWidget *parent); ~VPuzzleMainGraphicsView() = default; /** @@ -77,7 +77,7 @@ private: VMainGraphicsScene *m_scene{nullptr}; VPGraphicsSheet *m_graphicsSheet{nullptr}; - VPuzzleLayout *m_layout{nullptr}; + VPLayout *m_layout{nullptr}; QList m_graphicsPieces{}; diff --git a/src/app/puzzle/xml/vplayoutfilereader.cpp b/src/app/puzzle/xml/vplayoutfilereader.cpp index fc41231d8..722cb8c73 100644 --- a/src/app/puzzle/xml/vplayoutfilereader.cpp +++ b/src/app/puzzle/xml/vplayoutfilereader.cpp @@ -47,7 +47,7 @@ VPLayoutFileReader::~VPLayoutFileReader() //--------------------------------------------------------------------------------------------------------------------- -bool VPLayoutFileReader::ReadFile(VPuzzleLayout *layout, QFile *file) +bool VPLayoutFileReader::ReadFile(VPLayout *layout, QFile *file) { setDevice(file); @@ -60,7 +60,7 @@ bool VPLayoutFileReader::ReadFile(VPuzzleLayout *layout, QFile *file) } //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileReader::ReadLayout(VPuzzleLayout *layout) +void VPLayoutFileReader::ReadLayout(VPLayout *layout) { SCASSERT(isStartElement() && name() == ML::TagLayout); @@ -82,7 +82,7 @@ void VPLayoutFileReader::ReadLayout(VPuzzleLayout *layout) } //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileReader::ReadProperties(VPuzzleLayout *layout) +void VPLayoutFileReader::ReadProperties(VPLayout *layout) { SCASSERT(isStartElement() && name() == ML::TagProperties); @@ -158,7 +158,7 @@ void VPLayoutFileReader::ReadProperties(VPuzzleLayout *layout) } //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileReader::ReadTiles(VPuzzleLayout *layout) +void VPLayoutFileReader::ReadTiles(VPLayout *layout) { Q_UNUSED(layout); // to be removed when used @@ -193,7 +193,7 @@ void VPLayoutFileReader::ReadTiles(VPuzzleLayout *layout) } //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileReader::ReadPieceLists(VPuzzleLayout *layout) +void VPLayoutFileReader::ReadPieceLists(VPLayout *layout) { SCASSERT(isStartElement() && name() == ML::TagPieceLists); diff --git a/src/app/puzzle/xml/vplayoutfilereader.h b/src/app/puzzle/xml/vplayoutfilereader.h index a161bc5e6..d340811b9 100644 --- a/src/app/puzzle/xml/vplayoutfilereader.h +++ b/src/app/puzzle/xml/vplayoutfilereader.h @@ -31,26 +31,26 @@ #include #include "../ifc/xml/vabstractconverter.h" -#include "vpuzzlelayout.h" +#include "vplayout.h" #include "vppiecelist.h" #include "vpuzzlepiece.h" class VPLayoutFileReader : public QXmlStreamReader { - Q_DECLARE_TR_FUNCTIONS(VPuzzleLayoutFileReader) + Q_DECLARE_TR_FUNCTIONS(VPLayoutFileReader) public: VPLayoutFileReader(); ~VPLayoutFileReader(); - bool ReadFile(VPuzzleLayout *layout, QFile *file); + bool ReadFile(VPLayout *layout, QFile *file); private: Q_DISABLE_COPY(VPLayoutFileReader) - void ReadLayout(VPuzzleLayout *layout); - void ReadProperties(VPuzzleLayout *layout); - void ReadTiles(VPuzzleLayout *layout); - void ReadPieceLists(VPuzzleLayout *layout); + void ReadLayout(VPLayout *layout); + void ReadProperties(VPLayout *layout); + void ReadTiles(VPLayout *layout); + void ReadPieceLists(VPLayout *layout); void ReadPieceList(VPPieceList *pieceList); void ReadPiece(VPuzzlePiece *piece); diff --git a/src/app/puzzle/xml/vplayoutfilewriter.cpp b/src/app/puzzle/xml/vplayoutfilewriter.cpp index bd6a05202..97d738928 100644 --- a/src/app/puzzle/xml/vplayoutfilewriter.cpp +++ b/src/app/puzzle/xml/vplayoutfilewriter.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vplayoutfilewriter.h" -#include "vpuzzlelayout.h" +#include "vplayout.h" #include "vppiecelist.h" #include "vpuzzlepiece.h" #include "vplayoutliterals.h" @@ -46,7 +46,7 @@ VPLayoutFileWriter::~VPLayoutFileWriter() } //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileWriter::WriteFile(VPuzzleLayout *layout, QFile *file) +void VPLayoutFileWriter::WriteFile(VPLayout *layout, QFile *file) { setDevice(file); setAutoFormatting(true); @@ -59,7 +59,7 @@ void VPLayoutFileWriter::WriteFile(VPuzzleLayout *layout, QFile *file) } //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileWriter::WriteLayout(VPuzzleLayout *layout) +void VPLayoutFileWriter::WriteLayout(VPLayout *layout) { writeStartElement(ML::TagLayout); SetAttribute(ML::AttrVersion, VLayoutConverter::LayoutMaxVerStr); @@ -71,7 +71,7 @@ void VPLayoutFileWriter::WriteLayout(VPuzzleLayout *layout) } //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileWriter::WriteProperties(VPuzzleLayout *layout) +void VPLayoutFileWriter::WriteProperties(VPLayout *layout) { writeStartElement(ML::TagProperties); @@ -97,7 +97,7 @@ void VPLayoutFileWriter::WriteProperties(VPuzzleLayout *layout) } //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileWriter::WriteTiles(VPuzzleLayout *layout) +void VPLayoutFileWriter::WriteTiles(VPLayout *layout) { Q_UNUSED(layout); // to be removed @@ -116,7 +116,7 @@ void VPLayoutFileWriter::WriteTiles(VPuzzleLayout *layout) //--------------------------------------------------------------------------------------------------------------------- -void VPLayoutFileWriter::WritePieceLists(VPuzzleLayout *layout) +void VPLayoutFileWriter::WritePieceLists(VPLayout *layout) { writeStartElement(ML::TagPieceLists); diff --git a/src/app/puzzle/xml/vplayoutfilewriter.h b/src/app/puzzle/xml/vplayoutfilewriter.h index 4fc4f646b..522b2ad8a 100644 --- a/src/app/puzzle/xml/vplayoutfilewriter.h +++ b/src/app/puzzle/xml/vplayoutfilewriter.h @@ -34,7 +34,7 @@ #include "../vmisc/literals.h" -class VPuzzleLayout; +class VPLayout; class VPPieceList; class VPuzzlePiece; class QFile; @@ -46,14 +46,14 @@ public: VPLayoutFileWriter(); ~VPLayoutFileWriter(); - void WriteFile(VPuzzleLayout *layout, QFile *file); + void WriteFile(VPLayout *layout, QFile *file); private: - void WriteLayout(VPuzzleLayout *layout); - void WriteProperties(VPuzzleLayout *layout); - void WriteTiles(VPuzzleLayout *layout); - void WritePieceLists(VPuzzleLayout *layout); + void WriteLayout(VPLayout *layout); + void WriteProperties(VPLayout *layout); + void WriteTiles(VPLayout *layout); + void WritePieceLists(VPLayout *layout); void WritePieceList(VPPieceList *pieceList); void WritePieceList(VPPieceList *pieceList, const QString &tagName); void WritePiece(VPuzzlePiece *piece);