EComboBox and StringListEdit improvments

This commit is contained in:
2021-07-06 17:36:40 +03:00
parent 3f7306cea6
commit e3a87fbb9b
9 changed files with 178 additions and 146 deletions

View File

@@ -1,12 +1,11 @@
#include <QStandardItemModel>
#include <QApplication>
#include <QDebug>
#include <QHeaderView>
#include <QStandardItemModel>
#include "ecombobox.h"
#include "qad_types.h"
class EModel: public QStandardItemModel {
class QAD_WIDGETS_EXPORT EModel: public QStandardItemModel {
public:
EModel(QObject * parent = 0): QStandardItemModel(parent) {
#if QT_VERSION < 0x050000
@@ -21,10 +20,12 @@ protected:
}
#if QT_VERSION >= 0x050000
Qt::DropActions supportedDragActions() const {return Qt::MoveAction;}
Qt::DropActions supportedDropActions() const {return Qt::MoveAction;}
#endif
};
EComboBox::EComboBox(QWidget * parent): QComboBox(parent) {
setView(&iv);
setModel(new EModel());
@@ -52,6 +53,7 @@ EComboBox::EComboBox(QWidget * parent): QComboBox(parent) {
header.layout()->addWidget(&filter);
header.setParent(iv.header());
connect(&filter, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
connect(model(), &EModel::layoutChanged, this, &EComboBox::rowsChanged);
}