#ifndef POWERITEMWIDGET_H
#define POWERITEMWIDGET_H

#include <QWidget>
#include <QLabel>

class StatusButton;

class PowerItemWidget : public QFrame
{
    Q_OBJECT

public:
    explicit PowerItemWidget(QWidget *parent = 0);
    ~PowerItemWidget();
    void setText(const QString text);
    void setToolTip(const QString tip);
    void setIcon(const QIcon &icon);
    /**
     * @brief 设置按钮当前状态
     * @param selected 是否选中
     * @return
     */
    void setSelected(int status);

protected:
    bool eventFilter(QObject *obj, QEvent *event);

Q_SIGNALS:
    /**
     * @brief 响应点击事件
     * @return
     */
    void clicked();

private:
    StatusButton *itemFace = nullptr;
    QLabel *textLabel = nullptr;
};

#endif // POWERITEMWIDGET_H
