mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-19 15:20:41 -05:00
Fix some issues with map connections after layout split
This commit is contained in:
@@ -10,22 +10,20 @@
|
||||
class ConnectionPixmapItem : public QObject, public QGraphicsPixmapItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConnectionPixmapItem(MapConnection* connection, int originX, int originY);
|
||||
ConnectionPixmapItem(MapConnection* connection, QPoint origin);
|
||||
ConnectionPixmapItem(MapConnection* connection);
|
||||
|
||||
const QPointer<MapConnection> connection;
|
||||
|
||||
void setOrigin(int x, int y);
|
||||
void setOrigin(QPoint pos);
|
||||
|
||||
void setEditable(bool editable);
|
||||
bool getEditable();
|
||||
|
||||
void setSelected(bool selected);
|
||||
|
||||
void updatePos();
|
||||
void render(bool ignoreCache = false);
|
||||
|
||||
signals:
|
||||
void positionChanged(qreal x, qreal y);
|
||||
|
||||
private:
|
||||
QPixmap basePixmap;
|
||||
qreal originX;
|
||||
@@ -36,6 +34,10 @@ private:
|
||||
static const int mWidth = 16;
|
||||
static const int mHeight = 16;
|
||||
|
||||
void updatePos();
|
||||
void updateOrigin();
|
||||
void refresh();
|
||||
|
||||
protected:
|
||||
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
|
||||
virtual void mousePressEvent(QGraphicsSceneMouseEvent*) override;
|
||||
|
||||
@@ -23,7 +23,6 @@ public:
|
||||
explicit ConnectionsListItem(QWidget *parent, MapConnection *connection, const QStringList &mapNames);
|
||||
~ConnectionsListItem();
|
||||
|
||||
void updateUI();
|
||||
void setSelected(bool selected);
|
||||
|
||||
private:
|
||||
@@ -33,6 +32,8 @@ private:
|
||||
bool isSelected = false;
|
||||
unsigned actionId = 0;
|
||||
|
||||
void updateUI();
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent(QMouseEvent*) override;
|
||||
virtual void focusInEvent(QFocusEvent*) override;
|
||||
|
||||
Reference in New Issue
Block a user