Skip to content

Class PluginModel

ClassList > PluginModel

Inherits the following classes: QAbstractListModel

Public Types

Type Name
enum PluginRoles

Public Properties

Type Name
property bool isRefreshing

Public Signals

Type Name
signal void isRefreshingChanged
signal void remoteFetched

Public Functions

Type Name
PluginModel (PluginManager * manager, QObject * parent=nullptr)
QList< PluginInformation > availableAppPlugins () const
QVariant data (const QModelIndex & index, int role=Qt::DisplayRole) override const
bool hasPluginInformation (const QString & uuid) const
bool isRefreshing () const
PluginInformation pluginInformation (const QString & uuid) const
Q_INVOKABLE void refresh (bool fetchRemote=false)
QHash< int, QByteArray > roleNames () override const
int rowCount (const QModelIndex & parent=QModelIndex()) override const
bool setData (const QModelIndex & index, const QVariant & value, int role) override
Q_INVOKABLE void updatePluginEnabledStateByUuid (const QString & uuid, bool enabled, bool configurable)

Public Types Documentation

enum PluginRoles

enum PluginModel::PluginRoles {
    UuidRole = Qt::UserRole + 1,
    TrustedRole,
    EnabledRole,
    ConfigurableRole,
    NameRole,
    DescriptionRole,
    AuthorRole,
    HomepageRole,
    IconRole,
    VersionRole,
    InstalledLocallyRole,
    AvailableRemotelyRole,
    AvailableUpdateRole
};

Public Properties Documentation

property isRefreshing [1/2]

bool PluginModel::isRefreshing;

Public Signals Documentation

signal isRefreshingChanged

void PluginModel::isRefreshingChanged;

signal remoteFetched

void PluginModel::remoteFetched;

Public Functions Documentation

function PluginModel

explicit PluginModel::PluginModel (
    PluginManager * manager,
    QObject * parent=nullptr
) 

Constructs a PluginModel.


function availableAppPlugins

QList< PluginInformation > PluginModel::availableAppPlugins () const

Returns the list of available app plugins installed locally.


function data

QVariant PluginModel::data (
    const QModelIndex & index,
    int role=Qt::DisplayRole
) override const

Returns the data for index and role.


function hasPluginInformation

bool PluginModel::hasPluginInformation (
    const QString & uuid
) const

Returns true if the model contains a plugin with the given uuid.


function isRefreshing [2/2]

bool PluginModel::isRefreshing () const

Returns true if the model is currently fetching remote plugins.


function pluginInformation

PluginInformation PluginModel::pluginInformation (
    const QString & uuid
) const

Returns the pluginInformation information for the pluginInformation identified by uuid.


function refresh

Q_INVOKABLE void PluginModel::refresh (
    bool fetchRemote=false
) 

Refreshes the model.

Parameters:

  • fetchRemote set to TRUE to fetch remotely available plugins

function roleNames

QHash< int, QByteArray > PluginModel::roleNames () override const

Returns the role names used by this model.


function rowCount

int PluginModel::rowCount (
    const QModelIndex & parent=QModelIndex()
) override const

Returns the number of plugins in the model.


function setData

bool PluginModel::setData (
    const QModelIndex & index,
    const QVariant & value,
    int role
) override

Sets the data for index and role to value.


function updatePluginEnabledStateByUuid

Q_INVOKABLE void PluginModel::updatePluginEnabledStateByUuid (
    const QString & uuid,
    bool enabled,
    bool configurable
) 

Updates the enabled and configurable state of the plugin with uuid.



The documentation for this class was generated from the following file src/core/pluginmodel.h