Commit 9d97532a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Stay compatible with older Qt...

parent 302178f4
...@@ -31,10 +31,8 @@ OperatorsModel::OperatorsModel(QObject *parent) : QAbstractTableModel(parent), m ...@@ -31,10 +31,8 @@ OperatorsModel::OperatorsModel(QObject *parent) : QAbstractTableModel(parent), m
QHash<int, QByteArray> OperatorsModel::roleNames() const QHash<int, QByteArray> OperatorsModel::roleNames() const
{ {
auto ret = QAbstractTableModel::roleNames(); auto ret = QAbstractTableModel::roleNames();
ret.insert({ ret.insert(IsVariableRole, "isVariable");
{IsVariableRole, "isVariable"}, ret.insert(DescriptionRole, "description");
{DescriptionRole, "description"}
});
return ret; return ret;
} }
......
...@@ -48,9 +48,7 @@ PlotsModel::~PlotsModel() ...@@ -48,9 +48,7 @@ PlotsModel::~PlotsModel()
QHash<int, QByteArray> PlotsModel::roleNames() const QHash<int, QByteArray> PlotsModel::roleNames() const
{ {
auto ret = QAbstractListModel::roleNames(); auto ret = QAbstractListModel::roleNames();
ret.insert({ ret.insert(DescriptionRole, "description");
{ DescriptionRole, "description" }
});
return ret; return ret;
} }
......
...@@ -35,5 +35,10 @@ void AnalitzaDeclarativePlugin::registerTypes(const char* uri) ...@@ -35,5 +35,10 @@ void AnalitzaDeclarativePlugin::registerTypes(const char* uri)
qmlRegisterType<Analitza::PlotsModel>(uri, 1, 0, "PlotsModel"); qmlRegisterType<Analitza::PlotsModel>(uri, 1, 0, "PlotsModel");
qmlRegisterType<Analitza::VariablesModel>(uri, 1, 0, "VariablesModel"); qmlRegisterType<Analitza::VariablesModel>(uri, 1, 0, "VariablesModel");
qmlRegisterType<OperatorsModel>(uri, 1, 0, "OperatorsModel"); qmlRegisterType<OperatorsModel>(uri, 1, 0, "OperatorsModel");
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
qmlRegisterInterface<Analitza::Variables*>("Analitza::Variables");
#else
qmlRegisterInterface<Analitza::Variables>(uri, 1); qmlRegisterInterface<Analitza::Variables>(uri, 1);
#endif
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment