-
Notifications
You must be signed in to change notification settings - Fork 1
/
blockitemselectordialog.h
49 lines (35 loc) · 1.16 KB
/
blockitemselectordialog.h
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
#ifndef BLOCKITEMSELECTORDIALOG_H
#define BLOCKITEMSELECTORDIALOG_H
#include "inventoryslot.h"
#include "inventoryitemfiltermodel.h"
#include <QDialog>
#include <QStandardItemModel>
#include <QPushButton>
namespace Ui {
class BlockItemSelectorDialog;
}
class BlockItemSelectorDialog : public QDialog
{
Q_OBJECT
public:
using SelectCategory = InventorySlot::SelectCategory;
using FilterModel = InventoryItemFilterModel;
explicit BlockItemSelectorDialog(QWidget *parent = nullptr,
SelectCategory category = SelectCategory::ObtainableItems);
~BlockItemSelectorDialog();
QString getSelectedID();
QVector<InventoryItem> getSelectedItems();
void setAllowMultiple(bool value);
void setCategory(const SelectCategory &category);
private slots:
void checkOK();
private:
InventoryItemFilterModel filterModel;
QStandardItemModel model;
Ui::BlockItemSelectorDialog *ui;
QPushButton *selectButton = nullptr;
SelectCategory m_category = SelectCategory::ObtainableItems;
bool allowMultiple = true;
void setupListView();
};
#endif /* BLOCKITEMSELECTORDIALOG_H */