blob: 06fe993584c8e15765bde4a7c228b4db99dcef2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#ifndef LISTSINGLETON_H
#define LISTSINGLETON_H
#include <QObject>
#include <QtQml/qqml.h>
#include <QtQml/qqmlregistration.h>
class ListSingleton : public QObject {
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
ListSingleton(QObject *parent = nullptr) : QObject(parent) {}
Q_INVOKABLE QStringList get() const
{
return { QStringLiteral("one"), QStringLiteral("two"), QStringLiteral("three") };
}
};
#endif // LISTSINGLETON_H
|