-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtilepicker.h
More file actions
69 lines (54 loc) · 1.46 KB
/
tilepicker.h
File metadata and controls
69 lines (54 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef TILEPICKER_H
#define TILEPICKER_H
#include <QDockWidget>
#include <QTableWidgetItem>
class MainWindow;
namespace Ui {
class TilePicker;
class TilePickerTable;
}
class TilePicker : public QDockWidget
{
Q_OBJECT
public:
explicit TilePicker(QWidget *parent, MainWindow* main_window);
~TilePicker();
void Update();
void RedrawSelection();
void resizeEvent(QResizeEvent* event);
private slots:
void on_tblTiles_cellClicked(int row, int column);
void on_tblTiles_customContextMenuRequested(const QPoint &pos);
void on_tblTiles_cellDoubleClicked(int row, int column);
void on_changeBgSelection();
void on_editTileTriggered();
void on_duplicateTileTriggered();
void on_deleteTileTriggered();
private:
Ui::TilePicker *ui;
MainWindow* main_window;
QMenu* context_menu= nullptr;
int tile_hovered= 0;
void OpenContextMenu(QPoint screen_pos, int tile_id);
#if QT_VERSION_MAJOR > 5
void enterEvent(QEnterEvent* event);
#else
void enterEvent(QEvent* event);
#endif
void leaveEvent(QEvent* event);
};
class TilePickerTable : public QTableWidget
{
Q_OBJECT
public:
explicit TilePickerTable(QWidget* parent);
private slots:
void on_itemPressed(QTableWidgetItem* item);
private:
Ui::TilePickerTable *ui;
QTableWidgetItem* dnd_start_cell= nullptr;
QRect dnd_answer_rect;
void dragMoveEvent(QDragMoveEvent* event);
void dropEvent(QDropEvent* event);
};
#endif // TILEPICKER_H