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
QHash<int, QByteArray> OperatorsModel::roleNames() const
{
auto ret = QAbstractTableModel::roleNames();
ret.insert({
{IsVariableRole, "isVariable"},
{DescriptionRole, "description"}
});
ret.insert(IsVariableRole, "isVariable");
ret.insert(DescriptionRole, "description");
return ret;
}
......
......@@ -48,9 +48,7 @@ PlotsModel::~PlotsModel()
QHash<int, QByteArray> PlotsModel::roleNames() const
{
auto ret = QAbstractListModel::roleNames();
ret.insert({
{ DescriptionRole, "description" }
});
ret.insert(DescriptionRole, "description");
return ret;
}
......
......@@ -35,5 +35,10 @@ void AnalitzaDeclarativePlugin::registerTypes(const char* uri)
qmlRegisterType<Analitza::PlotsModel>(uri, 1, 0, "PlotsModel");
qmlRegisterType<Analitza::VariablesModel>(uri, 1, 0, "VariablesModel");
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);
#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