2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2016 Research In Motion.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2012-12-21 23:42:47 +00:00
|
|
|
#ifndef CONF_H
|
|
|
|
#define CONF_H
|
|
|
|
|
2014-03-09 21:27:34 +00:00
|
|
|
#include <QtQml/QQmlContext>
|
|
|
|
#include <QtQml/QQmlListProperty>
|
2019-08-21 16:34:21 +00:00
|
|
|
#include <QtQml/qqml.h>
|
2012-12-21 23:42:47 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
class PartialScene : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QUrl container READ container WRITE setContainer NOTIFY containerChanged)
|
|
|
|
Q_PROPERTY(QString itemType READ itemType WRITE setItemType NOTIFY itemTypeChanged)
|
2019-08-21 16:34:21 +00:00
|
|
|
QML_ELEMENT
|
2020-01-16 12:42:11 +00:00
|
|
|
QML_ADDED_IN_VERSION(1, 0)
|
2012-12-21 23:42:47 +00:00
|
|
|
public:
|
2021-10-15 14:09:09 +00:00
|
|
|
PartialScene(QObject *parent = nullptr) : QObject(parent)
|
2012-12-21 23:42:47 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
const QUrl container() const { return m_container; }
|
|
|
|
const QString itemType() const { return m_itemType; }
|
|
|
|
|
|
|
|
void setContainer(const QUrl &a) {
|
|
|
|
if (a==m_container)
|
|
|
|
return;
|
|
|
|
m_container = a;
|
2022-12-07 06:27:01 +00:00
|
|
|
Q_EMIT containerChanged();
|
2012-12-21 23:42:47 +00:00
|
|
|
}
|
|
|
|
void setItemType(const QString &a) {
|
|
|
|
if (a==m_itemType)
|
|
|
|
return;
|
|
|
|
m_itemType = a;
|
2022-12-07 06:27:01 +00:00
|
|
|
Q_EMIT itemTypeChanged();
|
2012-12-21 23:42:47 +00:00
|
|
|
}
|
|
|
|
|
2022-12-07 06:27:01 +00:00
|
|
|
Q_SIGNALS:
|
2012-12-21 23:42:47 +00:00
|
|
|
void containerChanged();
|
|
|
|
void itemTypeChanged();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QUrl m_container;
|
|
|
|
QString m_itemType;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Config : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QQmlListProperty<PartialScene> sceneCompleters READ sceneCompleters)
|
|
|
|
Q_CLASSINFO("DefaultProperty", "sceneCompleters")
|
2019-08-21 16:34:21 +00:00
|
|
|
QML_NAMED_ELEMENT(Configuration)
|
2020-01-16 12:42:11 +00:00
|
|
|
QML_ADDED_IN_VERSION(1, 0)
|
2012-12-21 23:42:47 +00:00
|
|
|
public:
|
2021-06-30 09:28:32 +00:00
|
|
|
Config (QObject *parent = nullptr) : QObject(parent) {}
|
2012-12-21 23:42:47 +00:00
|
|
|
|
|
|
|
QQmlListProperty<PartialScene> sceneCompleters()
|
|
|
|
{
|
2019-11-25 13:49:07 +00:00
|
|
|
return QQmlListProperty<PartialScene>(this, &completers);
|
2012-12-21 23:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QList<PartialScene*> completers;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|