mirror of
https://github.com/huderlem/porymap.git
synced 2026-10-01 12:26:37 -05:00
Remove some Editor usage from EventPixmapItem
This commit is contained in:
@@ -39,10 +39,12 @@ private:
|
||||
bool releaseSelectionQueued = false;
|
||||
|
||||
signals:
|
||||
void positionChanged(Event *event);
|
||||
void xChanged(int);
|
||||
void yChanged(int);
|
||||
void spriteChanged(const QPixmap &pixmap);
|
||||
void selected(Event *event, bool toggle);
|
||||
void dragged(Event *event, const QPoint &oldPosition, const QPoint &newPosition);
|
||||
void released(Event *event, const QPoint &position);
|
||||
void doubleClicked(Event *event);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -32,25 +32,4 @@ signals:
|
||||
void clicked(QMouseEvent *event);
|
||||
};
|
||||
|
||||
class Editor;
|
||||
|
||||
// TODO: This should just be MapView. It makes map-based assumptions, and no other class inherits GraphicsView.
|
||||
class GraphicsView : public QGraphicsView
|
||||
{
|
||||
public:
|
||||
GraphicsView() : QGraphicsView() {}
|
||||
GraphicsView(QWidget *parent) : QGraphicsView(parent) {}
|
||||
|
||||
public:
|
||||
// GraphicsView_Object object;
|
||||
Editor *editor;
|
||||
protected:
|
||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
||||
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
virtual void moveEvent(QMoveEvent *event) override;
|
||||
};
|
||||
|
||||
//Q_DECLARE_METATYPE(GraphicsView)
|
||||
|
||||
#endif // GRAPHICSVIEW_H
|
||||
|
||||
@@ -5,13 +5,17 @@
|
||||
#include "graphicsview.h"
|
||||
#include "overlay.h"
|
||||
|
||||
class MapView : public GraphicsView
|
||||
class Editor;
|
||||
|
||||
class MapView : public QGraphicsView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MapView() : GraphicsView() {}
|
||||
MapView(QWidget *parent) : GraphicsView(parent) {}
|
||||
MapView() : QGraphicsView() {}
|
||||
MapView(QWidget *parent) : QGraphicsView(parent) {}
|
||||
|
||||
Editor *editor;
|
||||
|
||||
Overlay * getOverlay(int layer);
|
||||
void clearOverlayMap();
|
||||
@@ -73,6 +77,7 @@ public:
|
||||
protected:
|
||||
virtual void drawForeground(QPainter *painter, const QRectF &rect) override;
|
||||
virtual void keyPressEvent(QKeyEvent*) override;
|
||||
virtual void moveEvent(QMoveEvent *event) override;
|
||||
private:
|
||||
QMap<int, Overlay*> overlayMap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user