#ifndef PQMENU_H
#define PQMENU_H

#include <QMenuBar>
#include "classes/pqwidget.h"
#include "classes/pqaction.h"

class PQMenu;
class PQMenu : public QMenu {
    Q_OBJECT
    PQ_WIDGET_EX(QMenu)

public:
    Q_INVOKABLE explicit PQMenu(QWidget * parent=0);
    virtual ~PQMenu();

    Q_INVOKABLE QAction *addAction(const QString &text);
    Q_INVOKABLE QAction *addAction(const QString &iconPath, const QString &text);
    Q_INVOKABLE void addAction(QAction *action);
    Q_INVOKABLE void addMenu(QMenu *menu);
    Q_INVOKABLE void addSeparator();
    Q_INVOKABLE void exec();

public Q_SLOTS:
    void aboutToHide_pslot();
    void aboutToShow_pslot();
    void hovered_pslot(QAction *action);
    void hovered_pslot();
    void triggered_pslot(QAction *action);
    void triggered_pslot();

    PQ_ON_SIGNAL_DECL_START {
        PQ_ON_SIGNAL(aboutToHide_pslot());
        PQ_ON_SIGNAL(aboutToShow_pslot());
        PQ_ON_SIGNAL(hovered_pslot(QAction*));
        PQ_ON_SIGNAL(triggered_pslot(QAction*));
        PQWIDGET_ON_SIGNALS();
    } PQ_ON_SIGNAL_DECL_END

};

Q_DECLARE_METATYPE(QMenu*)
Q_DECLARE_METATYPE(PQMenu*)

#endif // PQMENU_H
