-
Notifications
You must be signed in to change notification settings - Fork 4
/
itemattributes.h
59 lines (46 loc) · 1.45 KB
/
itemattributes.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
50
51
52
53
54
55
56
57
58
59
#ifndef ITEMATTRIBUTES_H
#define ITEMATTRIBUTES_H
#include <QMultiHash>
/*#include <QPair>
#include <QList>
#include <QHash>*/
#include <QLabel>
#include <QSpinBox>
#include <QCheckBox>
#include <QWidget>
#include "tibiaitem.h"
#include "ui_itemattributes.h"
class DatFormat;
typedef QMultiHash<quint8, QWidget *> WidgetHash;
/*typedef QPair<QLabel*, QSpinBox*> ValuePair;
typedef QList<ValuePair> ValueList;
typedef QPair<QCheckBox*, ValueList> AttributePair;
typedef QHash<quint8, AttributePair> AttributeHash;*/
class ItemAttributes : public QWidget
{
Q_OBJECT
public:
ItemAttributes( QWidget *parent = 0 );
virtual ~ItemAttributes( void );
void showValues( bool shown ) {
ui->valueArea->setShown( shown );
};
void setFormat( DatFormat *datFormat );
void setHeaders( const HeaderList& headerList );
void getHeaders( HeaderList& headerList );
void setAttributes( const PropertyList& properties );
void getAttributes( PropertyList& properties );
QCheckBox *getHeader( quint8 header ) const;
QLabel *getLabel( quint8 header, quint8 index, quint8 size ) const;
QSpinBox *getValue( quint8 header, quint8 index, quint8 size ) const;
public slots:
void onSetupContents( void );
void onResetContents( void );
void onUnloadContents( void );
private:
Ui::ItemAttributesClass *ui;
//AttributeHash attributeHash;
WidgetHash widgetHash;
DatFormat *m_datFormat;
};
#endif // ITEMATTRIBUTES_H