Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Analitza
Commits
302178f4
Commit
302178f4
authored
Feb 28, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
Port away from deprecated API
Makes sure it works properly with Qt 5.15
parent
054e61b4
Changes
4
Hide whitespace changes
Inline
Side-by-side
analitza/variables.h
View file @
302178f4
...
...
@@ -19,6 +19,7 @@
#ifndef VARIABLES_H
#define VARIABLES_H
#include <qobjectdefs.h>
#include <QHash>
#include "analitzaexport.h"
...
...
@@ -41,6 +42,7 @@ class Object;
class
ANALITZA_EXPORT
Variables
:
public
QHash
<
QString
,
Object
*>
{
Q_GADGET
public:
/**
* Creates an empty variable hash table with the usual constants
...
...
analitzagui/operatorsmodel.cpp
View file @
302178f4
...
...
@@ -30,10 +30,12 @@ OperatorsModel::OperatorsModel(QObject *parent) : QAbstractTableModel(parent), m
QHash
<
int
,
QByteArray
>
OperatorsModel
::
roleNames
()
const
{
return
QAbstractTableModel
::
roleNames
().
unite
(
{
{
IsVariableRole
,
"isVariable"
},
{
DescriptionRole
,
"description"
}
auto
ret
=
QAbstractTableModel
::
roleNames
();
ret
.
insert
({
{
IsVariableRole
,
"isVariable"
},
{
DescriptionRole
,
"description"
}
});
return
ret
;
}
QVariant
OperatorsModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
...
...
analitzaplot/plotsmodel.cpp
View file @
302178f4
...
...
@@ -47,7 +47,11 @@ PlotsModel::~PlotsModel()
QHash
<
int
,
QByteArray
>
PlotsModel
::
roleNames
()
const
{
return
QAbstractListModel
::
roleNames
().
unite
({{
DescriptionRole
,
"description"
}});
auto
ret
=
QAbstractListModel
::
roleNames
();
ret
.
insert
({
{
DescriptionRole
,
"description"
}
});
return
ret
;
}
void
PlotsModel
::
clear
()
...
...
declarative/analitzadeclarativeplugin.cpp
View file @
302178f4
...
...
@@ -35,5 +35,5 @@ 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"
);
qmlRegisterInterface
<
Analitza
::
Variables
*
>
(
"Analitza::Variables"
);
qmlRegisterInterface
<
Analitza
::
Variables
>
(
uri
,
1
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment