#ifndef FORMERROR_H
#define FORMERROR_H

#include "DataTypeDef.h"
#include <QWidget>
#include <QMap>

namespace Ui {
class FormError;
}

class FormError : public QWidget
{
    Q_OBJECT

public:
    explicit FormError(const int& gun_id, QWidget *parent = nullptr);
    ~FormError();

    void setError(const int& error, const QString& error_str);

protected:
    bool event(QEvent *event) override;

private slots:
    void slotValueChanged(const UINT32_QSTRING_MAP &error);

private:
    QString getErrorImageUrl(const int& error);
    
private:
    Ui::FormError *ui;
    int m_gun_id;
    bool m_error_tips_visible;
};

#endif // FORMERROR_H
