QtAutoUpdater  3.0.0
A Qt library to automatically check for updates and install them
Public Member Functions | List of all members
QtAutoUpdater::UpdaterPlugin Class Referenceabstract

The plugin interface to implement to create an updater plugin. More...

#include <updaterplugin.h>

Public Member Functions

virtual UpdaterBackendcreate (QString key, QObject *parent)=0
 Create a new instance of that plugins updater backend. More...
 

Detailed Description

The plugin interface to implement to create an updater plugin.

Each custom plugin must implement one or more UpdaterBackend classes, each identified by a key. This key must be declared in the JSON-file of the plugin using the following format:

{
"Keys": [ "my-backend1", "my-backend2", ... ]
}

Your plugin implementation must include the following in the class declaration:

Q_OBJECT
Q_PLUGIN_METADATA(IID QtAutoUpdater_UpdaterPlugin_iid FILE "my-backend.json")
See also
UpdaterBackend, QtAutoUpdater_UpdaterPlugin_iid, Updater Backend Plugins

Definition at line 10 of file updaterplugin.h.

Member Function Documentation

◆ create()

QtAutoUpdater::UpdaterPlugin::create ( QString  key,
QObject parent 
)
pure virtual

Create a new instance of that plugins updater backend.

Parameters
keyThe backend to be created
parentThe parent object of the backend to be created
Returns
The newly created backend or nullptr on an error

Your implementation must return a valid backend instance for each backend declared in the json file. If a key is passed to the function that was not declared (which should never happen), simply return a nullptr to indicate the failure.

Please note that the backend should not be set up on it's creation. This is done by the UpdaterBackend::initialize method by whomever calls this method.

See also
UpdaterBackend

The documentation for this class was generated from the following files:
QtAutoUpdater_UpdaterPlugin_iid
#define QtAutoUpdater_UpdaterPlugin_iid
The IID of the QtAutoUpdater::UpdaterPlugin interface.
Definition: updaterplugin.h:25
QtAutoUpdater::UpdaterPlugin
The plugin interface to implement to create an updater plugin.
Definition: updaterplugin.h:10