You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/iBase/iPlugin/QListViewEx.h

42 lines
1000 B
C++

#pragma once
#include <iPlugin_global.h>
#include <QStringList>
#include <QComboBox>
#include <QHeaderView>
#include <QDebug>
#include <QPainter>
#include <QListWidget>
#include <QCheckBox>
#include <QStandardItem>
// 为了QCombobox下拉列表添加QCheckBox复选框创建QListViewEx
class I_PLUGIN_EXPORT QListViewEx : public QListWidget
{
Q_OBJECT
public:
QListViewEx(QWidget* parent, QStringList *listItems, QStringList *listItemAlls, QComboBox* pComboBox);
//返回用户选择项的用户自定义数据
bool getSelectItems(QStringList &data);
private slots:
// Check状态改变
void slotCheckBoxChanged(int state);
private:
// 相关的变量,主要为控制
QComboBox* m_pComboBox;
QStringList m_listItems;
QStringList m_listItemAlls;
QList<bool> m_listChecked;
QList<QVariant> m_listItemData;
QList<QCheckBox*> m_listCheckBoxes;
bool m_bAllConsider;
bool m_bByAll;
QMap<QCheckBox*, bool> m_mapRawStates;
};