Refactoring VPuzzleMimeDataPiece
This commit is contained in:
parent
2accd83d6b
commit
6079d69c93
|
@ -16,8 +16,8 @@ SOURCES += \
|
|||
$$PWD/vplayout.cpp \
|
||||
$$PWD/vpmaingraphicsview.cpp \
|
||||
$$PWD/vpmainwindow.cpp \
|
||||
$$PWD/vpmimedatapiece.cpp \
|
||||
$$PWD/vppiecelist.cpp \
|
||||
$$PWD/vpuzzlemimedatapiece.cpp \
|
||||
$$PWD/vpuzzlepiece.cpp \
|
||||
$$PWD/vpuzzlesettings.cpp \
|
||||
$$PWD/xml/vplayoutfilereader.cpp \
|
||||
|
@ -40,9 +40,9 @@ HEADERS += \
|
|||
$$PWD/vplayout.h \
|
||||
$$PWD/vpmaingraphicsview.h \
|
||||
$$PWD/vpmainwindow.h \
|
||||
$$PWD/vpmimedatapiece.h \
|
||||
$$PWD/vppiecelist.h \
|
||||
$$PWD/vpstable.h \
|
||||
$$PWD/vpuzzlemimedatapiece.h \
|
||||
$$PWD/vpuzzlepiece.h \
|
||||
$$PWD/vpuzzlesettings.h \
|
||||
$$PWD/xml/vplayoutfilereader.h \
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <QApplication>
|
||||
#include <QMenu>
|
||||
|
||||
#include "vpuzzlemimedatapiece.h"
|
||||
#include "vpmimedatapiece.h"
|
||||
#include "vpcarrouselpiecelist.h"
|
||||
#include "vpcarrousel.h"
|
||||
|
||||
|
@ -212,7 +212,7 @@ void VPCarrouselPiece::mouseMoveEvent(QMouseEvent *event)
|
|||
|
||||
// starts the dragging
|
||||
QDrag *drag = new QDrag(this);
|
||||
VPuzzleMimeDataPiece *mimeData = new VPuzzleMimeDataPiece();
|
||||
VPMimeDataPiece *mimeData = new VPMimeDataPiece();
|
||||
mimeData->SetPiecePtr(m_piece);
|
||||
mimeData->setObjectName("piecePointer");
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <QMimeData>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include "vpuzzlemimedatapiece.h"
|
||||
#include "vpmimedatapiece.h"
|
||||
#include "vppiecelist.h"
|
||||
#include "../vwidgets/vmaingraphicsscene.h"
|
||||
|
||||
|
@ -111,7 +111,7 @@ void VPMainGraphicsView::dropEvent(QDropEvent *event)
|
|||
|
||||
if(mime->objectName() == "piecePointer")
|
||||
{
|
||||
const VPuzzleMimeDataPiece *mimePiece = qobject_cast<const VPuzzleMimeDataPiece *> (mime);
|
||||
const VPMimeDataPiece *mimePiece = qobject_cast<const VPMimeDataPiece *> (mime);
|
||||
|
||||
VPuzzlePiece *piece = mimePiece->GetPiecePtr();
|
||||
if(piece != nullptr)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vpuzzlemimedatapiece.cpp
|
||||
** @file vpmimedatapiece.cpp
|
||||
** @author Ronan Le Tiec
|
||||
** @date 4 5, 2020
|
||||
**
|
||||
|
@ -26,28 +26,28 @@
|
|||
**
|
||||
*************************************************************************/
|
||||
|
||||
#include "vpuzzlemimedatapiece.h"
|
||||
#include "vpmimedatapiece.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPuzzleMimeDataPiece::VPuzzleMimeDataPiece()
|
||||
VPMimeDataPiece::VPMimeDataPiece()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPuzzleMimeDataPiece::~VPuzzleMimeDataPiece()
|
||||
VPMimeDataPiece::~VPMimeDataPiece()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPuzzlePiece* VPuzzleMimeDataPiece::GetPiecePtr() const
|
||||
VPuzzlePiece* VPMimeDataPiece::GetPiecePtr() const
|
||||
{
|
||||
return m_piece;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPuzzleMimeDataPiece::SetPiecePtr(VPuzzlePiece* piece)
|
||||
void VPMimeDataPiece::SetPiecePtr(VPuzzlePiece* piece)
|
||||
{
|
||||
m_piece = piece;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vpuzzlemimedatapiece.h
|
||||
** @file vpmimedatapiece.h
|
||||
** @author Ronan Le Tiec
|
||||
** @date 4 5, 2020
|
||||
**
|
||||
|
@ -26,21 +26,21 @@
|
|||
**
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef VPUZZLEMIMEDATAPIECE_H
|
||||
#define VPUZZLEMIMEDATAPIECE_H
|
||||
#ifndef VPMIMEDATAPIECE_H
|
||||
#define VPMIMEDATAPIECE_H
|
||||
|
||||
#include <QMimeData>
|
||||
|
||||
#include "vpuzzlepiece.h"
|
||||
|
||||
class VPuzzleMimeDataPiece : public QMimeData
|
||||
class VPMimeDataPiece : public QMimeData
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
VPuzzleMimeDataPiece();
|
||||
~VPuzzleMimeDataPiece();
|
||||
VPMimeDataPiece();
|
||||
~VPMimeDataPiece();
|
||||
|
||||
/**
|
||||
* @brief GetPiecePtr Returns the piece pointer of the mime data
|
||||
|
@ -55,11 +55,11 @@ public:
|
|||
void SetPiecePtr(VPuzzlePiece* piece);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(VPuzzleMimeDataPiece)
|
||||
Q_DISABLE_COPY(VPMimeDataPiece)
|
||||
|
||||
VPuzzlePiece *m_piece{nullptr};
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // VPUZZLEMIMEDATAPIECE_H
|
||||
#endif // VPMIMEDATAPIECE_H
|
Loading…
Reference in New Issue
Block a user