1.点击下拉列表的复选框区域

2.点击下拉列表的非复选框区域

完美解决下拉列表存在滚动条时,列表项不显示的问题

QHCustomComboBox.h
- #ifndef QHCUSTOMCOMBOBOX_H
- #define QHCUSTOMCOMBOBOX_H
-
- #include
- #include
- #include
- #include
- #include
- #include
-
- class QHCustomComboBox: public QComboBox
- {
- Q_OBJECT
-
- public:
- explicit QHCustomComboBox(QWidget* parent = nullptr);
-
- void addItem(const QString &text, const QVariant &variant = QVariant());
- void addIt