git-svn-id: svn://db.shs.com.ru/libs@164 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2017-02-22 13:00:46 +00:00
parent 02e0bddd09
commit a74150ff71
14 changed files with 62 additions and 31 deletions

View File

@@ -11,14 +11,6 @@
using namespace CDUtils;
QList<QAD::Enumerator> CDEnum2QADEnum(const PIVector<CDType::Enumerator> & el) {
QList<QAD::Enumerator> ret;
piForeachC (CDType::Enumerator & e, el)
ret << QAD::Enumerator(e.first, PI2QString(e.second));
return ret;
}
CDKItemModel::CDKItemModel(QObject *parent) : QAbstractItemModel(parent) {
root = 0;
internalRebuild();
@@ -233,8 +225,7 @@ QVariant CDKItem::value(CDType t, int role) const {
if (t.type() == "n") return t.toInt();
if (t.type() == "b") return t.toBool();
if (t.type() == "e") {
QAD::Enum et;
et.enum_list = CDEnum2QADEnum(t.enumValues());
QAD::Enum et = PI2QADEnum(t.enumValues());
et.selectValue(t.toInt());
if (role == Qt::EditRole) return QVariant::fromValue<QAD::Enum>(et);
else return et.selectedName();