qt/LedOK/base/loqtreewidget.h
2022-08-25 18:37:24 +08:00

35 lines
694 B
C++

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