qt/LedOK/base/loqtreewidget.h

35 lines
694 B
C
Raw Normal View History

2022-01-04 18:11:48 +08:00
#ifndef LOQTREEWIDGET_H
#define LOQTREEWIDGET_H
2022-08-25 18:37:24 +08:00
#include <QCheckBox>
2022-01-04 18:11:48 +08:00
#include <QTreeWidgetItem>
2022-08-25 18:37:24 +08:00
class LoQTreeWidget : public QTreeWidget {
2022-01-04 18:11:48 +08:00
Q_OBJECT
public:
enum CheckState {
CheckNone,
CheckOne,
CheckMulti
};
explicit LoQTreeWidget(QWidget *parent = nullptr);
void adjustCheckState();
2022-08-25 18:37:24 +08:00
QModelIndex indexFromItem(const QTreeWidgetItem *item, int column = 0) const {
return QTreeWidget::indexFromItem(item, column);
};
2022-01-04 18:11:48 +08:00
2022-08-25 18:37:24 +08:00
QCheckBox *fdIsSelAll;
2022-01-04 18:11:48 +08:00
signals:
void sigCheckStateChanged(int);
public slots:
void onCheckAll(bool checked);
private:
2022-08-25 18:37:24 +08:00
QHeaderView *m_header;
2022-01-04 18:11:48 +08:00
int m_checkState;
};
#endif // LOQTREEWIDGET_H