2012-12-21 23:42:47 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2016-01-19 11:23:05 +00:00
|
|
|
** Copyright (C) 2016 Research In Motion.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2012-12-21 23:42:47 +00:00
|
|
|
**
|
|
|
|
** This file is part of the tools applications of the Qt Toolkit.
|
|
|
|
**
|
2016-01-19 11:23:05 +00:00
|
|
|
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
2012-12-21 23:42:47 +00:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-28 11:55:39 +00:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
2016-01-19 11:23:05 +00:00
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-12-21 23:42:47 +00:00
|
|
|
**
|
2016-01-19 11:23:05 +00:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2012-12-21 23:42:47 +00:00
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
#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;
|
|
|
|
emit containerChanged();
|
|
|
|
}
|
|
|
|
void setItemType(const QString &a) {
|
|
|
|
if (a==m_itemType)
|
|
|
|
return;
|
|
|
|
m_itemType = a;
|
|
|
|
emit itemTypeChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
signals:
|
|
|
|
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
|