Tome
A generic data editor for games supporting arbitrary input and output formats.
vector2iwidget.h
1 #ifndef VECTOR2IWIDGET_H
2 #define VECTOR2IWIDGET_H
3 
4 #include <QHBoxLayout>
5 #include <QSpinBox>
6 #include <QVariant>
7 #include <QWidget>
8 
9 
10 namespace Tome
11 {
15  class Vector2IWidget : public QWidget
16  {
17  Q_OBJECT
18 
19  public:
24  explicit Vector2IWidget(QWidget* parent = 0);
25  ~Vector2IWidget();
26 
31  QVariant getValue() const;
32 
37  void setValue(const QVariant& v);
38 
39  private:
40  QHBoxLayout* layout;
41 
42  QSpinBox* spinBoxX;
43  QSpinBox* spinBoxY;
44  };
45 }
46 
47 #endif // VECTOR2IWIDGET_H
Definition: commandlineoptions.h:6
Allows editing two-dimensional vectors with integer components.
Definition: vector2iwidget.h:15
QVariant getValue() const
Returns the vector as QVariantMap with keys BuiltInType::Vector::X and BuiltInType::Vector::Y.
Definition: vector2iwidget.cpp:38
void setValue(const QVariant &v)
Sets the current vector.
Definition: vector2iwidget.cpp:46
Vector2IWidget(QWidget *parent=0)
Constructs a new widget for editing two-dimensional vectors with integer components.
Definition: vector2iwidget.cpp:11