ff7tk 0.80.25
Work with Final Fantasy 7 game data
ItemSelector.h
Go to the documentation of this file.
1/****************************************************************************/
2// copyright 2012 - 2020 Chris Rizzitello <sithlord48@gmail.com> //
3// //
4// This file is part of FF7tk //
5// //
6// FF7tk is free software: you can redistribute it and/or modify //
7// it under the terms of the GNU General Public License as published by //
8// the Free Software Foundation, either version 3 of the License, or //
9// (at your option) any later version. //
10// //
11// FF7tk is distributed in the hope that it will be useful, //
12// but WITHOUT ANY WARRANTY; without even the implied warranty of //
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14// GNU General Public License for more details. //
15/****************************************************************************/
16#pragma once
17
18#include <QWidget>
19
20#ifndef ff7tkwidgets_export_h
21 #include <ff7tkwidgets_export.h>
22#endif
23
24class QComboBox;
25class QPushButton;
26class QSpinBox;
27
28class FF7TKWIDGETS_EXPORT ItemSelector : public QWidget
29{
30 Q_OBJECT
31public:
32 explicit ItemSelector(QWidget *parent = nullptr);
33 int id();// current id
34 int combo_item_width();//width of the item box.
35 int combo_type_width();//width of the type box.
36 int qty_width();//width of qty area.
37 void setFixedHeight(int h);
38 void setFixedWidth(int w);
39signals:
40 void itemChanged(quint16);//return selected rawitem
41public slots:
42 void setCurrentItem(quint16 ff7item);
43 void setCurrentItem(int id, int qty);
44 void setMaximumQty(int maxQty);
45 void setEditableItemCombo(bool editable);
46private slots:
47 void setFilter(int type);
48 void comboItem_changed(int index);
49 void sb_qty_changed(int qty);
50 void btn_remove_clicked();
51private:
52 void init_display();
53 void init_connections();
54 void init_data();
55 int type_offset(int type);
56 QComboBox *combo_type = nullptr;
57 QComboBox *combo_item = nullptr;
58 QSpinBox *sb_qty = nullptr;
59 QPushButton *btn_remove = nullptr;
60 quint16 current_item = 0;
61};
Definition: ItemSelector.h:29
void itemChanged(quint16)