A singleton class to create instances of different QtAutoUpdater types. More...
#include <qmlautoupdatersingleton.h>
Public Member Functions | |
Q_INVOKABLE QVariant | createInfo (QVariant identifier, QString name, const QVariant &version, QVariantMap data={}) const |
Creates a QtAutoUpdater::UpdateInfo from the given parameters. | |
Q_INVOKABLE QVariantList | infosAsList (const QList< QtAutoUpdater::UpdateInfo > &infos) const |
Converts a list of QtAutoUpdater::UpdateInfos to a QVariantList, which can be consumed in QML. | |
Q_INVOKABLE QtAutoUpdater::Updater * | createUpdater (const QString &configPath, QObject *parent=nullptr) const |
Creates an updater instance using the given configuration file. More... | |
Q_INVOKABLE QtAutoUpdater::Updater * | createUpdater (QSettings *config, QObject *parent=nullptr) const |
Creates an updater instance using the given configuration object. More... | |
Q_INVOKABLE QtAutoUpdater::Updater * | createUpdater (QString key, QVariantMap configuration, QObject *parent=nullptr) const |
Creates an updater instance using the given backend and configuration. More... | |
Q_INVOKABLE QtAutoUpdater::Updater * | createUpdater (QObject *qmlConfigOrParent=nullptr) const |
Creates an updater instance using the given object as either QML configuration or as parent. More... | |
Q_INVOKABLE QtAutoUpdater::Updater * | createUpdater (QObject *qmlConfig, QObject *parent) const |
Creates an updater instance using the given QML configuration and parent. More... | |
A singleton class to create instances of different QtAutoUpdater types.
Definition at line 21 of file qmlautoupdatersingleton.h.
Q_INVOKABLE QtAutoUpdater::Updater* de::skycoder42::QtAutoUpdater::Core::QtAutoUpdater::createUpdater | ( | const QString & | configPath, |
QObject * | parent = nullptr |
||
) | const |
Creates an updater instance using the given configuration file.
configPath | The path to the configuration file |
parent | The object to be set as the parent for the created updater |
nullptr
, if unable to create one.The backend is loaded based on the given configuration file, which must be in the QSettings::IniFormat. It must contain the "backend" entry, set to the updater backend to be used. If the file does not exists or backend is invalid, nullptr is returned. Otherwise the created instance, initialized using the given configuration.
qApp
or nullptr
as parent for the updater.Q_INVOKABLE QtAutoUpdater::Updater* de::skycoder42::QtAutoUpdater::Core::QtAutoUpdater::createUpdater | ( | QObject * | qmlConfig, |
QObject * | parent | ||
) | const |
Creates an updater instance using the given QML configuration and parent.
qmlConfig | The configuration object |
parent | The object to be set as the parent for the created updater |
nullptr
, if unable to create one.The qmlConfig must be an instance of Qt.labs.settings.Settings or QSettings. If it is neither, no updater can be created an nullptr gets returned
The backend is loaded based on the given configuration. It must contain the "backend" entry, set to the updater backend to be used. If the backend is missing or invalid, nullptr is returned. Otherwise the created instance, initialized using the given configuration.
qApp
or nullptr
as parent for the updater.Q_INVOKABLE QtAutoUpdater::Updater* de::skycoder42::QtAutoUpdater::Core::QtAutoUpdater::createUpdater | ( | QObject * | qmlConfigOrParent = nullptr | ) | const |
Creates an updater instance using the given object as either QML configuration or as parent.
qmlConfigOrParent | The object to be consumed |
nullptr
, if unable to create one.The qmlConfigOrParent can be interpreted in different ways. If it is a Qt.labs.settings.Settings instance, it is used as the configuration, but not as the parent. Otherwise it is used as the parent.
The backend is loaded based on the given configuration. It must contain the "backend" entry, set to the updater backend to be used. If the backend is missing or invalid, nullptr is returned. Otherwise the created instance, initialized using the given configuration.
qApp
or nullptr
as parent for the updater.Q_INVOKABLE QtAutoUpdater::Updater* de::skycoder42::QtAutoUpdater::Core::QtAutoUpdater::createUpdater | ( | QSettings * | config, |
QObject * | parent = nullptr |
||
) | const |
Creates an updater instance using the given configuration object.
config | The configuration object |
parent | The object to be set as the parent for the created updater |
nullptr
, if unable to create one.The backend is loaded based on the given configuration. It must contain the "backend" entry, set to the updater backend to be used. If the backend is missing or invalid, nullptr is returned. Otherwise the created instance, initialized using the given configuration.
qApp
or nullptr
as parent for the updater.Q_INVOKABLE QtAutoUpdater::Updater* de::skycoder42::QtAutoUpdater::Core::QtAutoUpdater::createUpdater | ( | QString | key, |
QVariantMap | configuration, | ||
QObject * | parent = nullptr |
||
) | const |
Creates an updater instance using the given backend and configuration.
key | The key of the backend to be loaded |
configuration | The configuration to be passed to the backend to configure it |
parent | The object to be set as the parent for the created updater |
nullptr
, if unable to create one.The backend is loaded based on the given key. If no backend was found for the key, nullptr is returned. Otherwise the created instance. The configuration is used to initialize the backend.
qApp
or nullptr
as parent for the updater.