#ifndef PQBOXLAYOUT
#define PQBOXLAYOUT

#include <QBoxLayout>
#include "classes/pqwidget.h"

class PQBoxLayout;
class PQBoxLayout : public QBoxLayout {
    Q_OBJECT
    PQ_OBJECT_EX(QBoxLayout)

    Q_PROPERTY( int spacing READ spacing WRITE setSpacing )

public:
    Q_INVOKABLE explicit PQBoxLayout(QWidget *parent = 0);
    Q_INVOKABLE explicit PQBoxLayout(int direction, QWidget *parent = 0);
    virtual ~PQBoxLayout();

    Q_INVOKABLE int addSpacer(int w, int h, int hData = 1, int vData = 1);
    Q_INVOKABLE bool removeSpacer(int index);

    Q_INVOKABLE bool setAlignment(QWidget *w, int alignment);
    Q_INVOKABLE bool setAlignment(QLayout *l, int alignment);

public Q_SLOTS:
    Q_INVOKABLE void addWidget(QWidget *qw);
    Q_INVOKABLE void addLayout(QLayout *layout);

private:
    QHash<int, QSpacerItem *> spacers;
};

Q_DECLARE_METATYPE(QLayout*)
Q_DECLARE_METATYPE(PQBoxLayout*)

#endif // PQBOXLAYOUT

