#ifndef HEADERTYPE1_H
#define HEADERTYPE1_H

#include <QHeaderView>
#include "formheadertype1.h"

#include <vector>
using namespace std;

class HeaderType1 : public QHeaderView
{
    Q_OBJECT
public:
    explicit HeaderType1(Qt::Orientation orientation, QWidget *parent = nullptr);
    virtual ~HeaderType1();

    virtual void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const;
    //virtual void paintSection(QPainter *painter, const QRect &rect, int logicalIndex);

    virtual void InitHeader();

    void ChangeStyle();

    bool event(QEvent *e) override;

    void SetOrderHeaderIndex(int nID);

    virtual void ChangeHeader(QStringList& list);

    virtual void ClearHeader();

    int GetDisplayWidth();

    void resizeEvent(QResizeEvent *event) override;

    void SetListType(int nType);

    void SetResizeEnable(bool bEnable);



protected:
    int m_nListType;
    int m_nHorizontalOffset;
    vector<FormHeaderType1*> m_ListHeader;

    FormHeaderType1* m_pHeaderCurrent;


    bool m_bResizeEnable;



signals:
    void Resort(int nIndex, int nOrder);

public slots:
    void Clicked(int nID);
    void sectionResized(int logicalIndex, int oldSize, int newSize);


};

#endif // HEADERTYPE1_H
