mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 16:24:47 +02:00
Getting the variant list out to js right
This commit is contained in:
parent
3d412747d7
commit
b4682b31df
1 changed files with 12 additions and 2 deletions
|
@ -13,6 +13,16 @@
|
||||||
|
|
||||||
#include "Engine.h"
|
#include "Engine.h"
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
QVariantList toVariantList(const QList<T> &list)
|
||||||
|
{
|
||||||
|
QVariantList newList;
|
||||||
|
foreach(const T &item, list)
|
||||||
|
newList << item;
|
||||||
|
|
||||||
|
return newList;
|
||||||
|
}
|
||||||
|
|
||||||
namespace workload {
|
namespace workload {
|
||||||
class SetupViewsConfig : public Job::Config{
|
class SetupViewsConfig : public Job::Config{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -174,14 +184,14 @@ namespace workload {
|
||||||
static const int SIZE{ workload::Region::NUM_VIEW_REGIONS };
|
static const int SIZE{ workload::Region::NUM_VIEW_REGIONS };
|
||||||
float timings[SIZE];
|
float timings[SIZE];
|
||||||
glm::vec2 ranges[SIZE];
|
glm::vec2 ranges[SIZE];
|
||||||
QVector<qreal> _timings { 6, 2.0 };
|
QList<qreal> _timings { 6, 2.0 };
|
||||||
|
|
||||||
} dataExport;
|
} dataExport;
|
||||||
|
|
||||||
void emitDirty() { emit dirty(); }
|
void emitDirty() { emit dirty(); }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
Q_INVOKABLE QVector<qreal> getTimings() const { return dataExport._timings; }
|
Q_INVOKABLE QVariantList getTimings() const { return toVariantList(dataExport._timings); }
|
||||||
signals:
|
signals:
|
||||||
void dirty();
|
void dirty();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue