fix multi event deletion crash, allow spinboxes to commit move history

This commit is contained in:
garakmon
2020-07-31 13:24:58 -04:00
committed by garak
parent 2598ca2277
commit 4c154501f1
6 changed files with 60 additions and 32 deletions

View File

@@ -23,13 +23,12 @@ enum CommandId {
ID_EventCreate, // - done
ID_EventDelete, // - done
ID_EventSetData, // - ?
// Tileset editor history commands
// Region map editor history commands
};
/// TODO
///
class PaintMetatile : public QUndoCommand {
public:
PaintMetatile(Map *map,
@@ -233,7 +232,7 @@ private:
///
class EventDelete : public QUndoCommand {
public:
EventDelete(Editor *editor, Map *map, Event *event,
EventDelete(Editor *editor, Map *map, QList<Event *> selectedEvents,
QUndoCommand *parent = nullptr);
~EventDelete();
@@ -245,7 +244,7 @@ public:
private:
Map *map;
Event *event;
QList<Event *> selectedEvents; // allow multiple deletion of events
Editor *editor;
};

View File

@@ -99,15 +99,8 @@ public:
bool hFlip = false;
bool usingSprite;
void activate() { active = true; }
void deactivate() { active = false; }
bool isActive() { return active; }
DraggablePixmapItem *pixmapItem = nullptr;
void setPixmapItem(DraggablePixmapItem *item) { pixmapItem = item; }
private:
bool active = true;
};
#endif // EVENT_H

View File

@@ -10,6 +10,9 @@ class NoScrollSpinBox : public QSpinBox
public:
explicit NoScrollSpinBox(QWidget *parent = nullptr);
void wheelEvent(QWheelEvent *event);
void focusOutEvent(QFocusEvent *event) override;
unsigned getActionId();
private:
};