![]() |
LeechCraft
%{LEECHCRAFT_VERSION}
Modular cross-platform feature rich live environment.
|
Describes a single quark. More...
#include "iquarkcomponentprovider.h"
Public Member Functions | |
QuarkComponent () | |
Initializes a null quark component. More... | |
QuarkComponent (const QString &subdir, const QString &filename) | |
Initializes a quark component for the given file path. More... | |
~QuarkComponent () | |
Destroys the quark. More... | |
Public Attributes | |
QUrl | Url_ |
URL of the main QML of this file. More... | |
QList< QPair< QString, QObject * > > | DynamicProps_ |
Dynamic properties to be exposed to the engine. More... | |
QList< QPair< QString, QObject * > > | ContextProps_ |
Context-depended properties to be exposed to the engine. More... | |
QList< QPair< QString, QVariant > > | StaticProps_ |
QList< QPair< QString, QDeclarativeImageProvider * > > | ImageProviders_ |
Describes a single quark.
A single quark can be loaded in several different views at the same time. Each view defines a quark context. For example, the same panel of SB2 will have different contexts for different windows.
Quarks may want to communicate with the C++ part of the providing plugin. Quark properties serve exactly this purpose.
Different views can share some properties and may need to have different others according to the quark context. Shareable properties should be listed in DynamicProps_ and StaticProps_, while unique per-view properties should be listed in ContextProps_. Context per-view properties will be destroyed if the quark is removed from the view.
In other words, ownership of shareable properties is left for the quark component provider, while ownership of the context-dependent properties is transferred to the calling view.
Definition at line 69 of file iquarkcomponentprovider.h.
|
inline |
Initializes a null quark component.
Definition at line 95 of file iquarkcomponentprovider.h.
|
inline |
Initializes a quark component for the given file path.
This utility constructor provides an easy way to create a quark component for a QML file located in the Util::SysPath::QML location under the given subdir and filename.
For example, if a plugin installs its quark file QuarkName.qml contained in directory pluginName via
then proper QuarkComponent will be initialized by calling
.
Definition at line 114 of file iquarkcomponentprovider.h.
|
inline |
Destroys the quark.
Destroys the quark and all context-specific properties listed in the ContextProps_ list.
Definition at line 124 of file iquarkcomponentprovider.h.
QList<QPair<QString, QObject*> > LeechCraft::QuarkComponent::ContextProps_ |
Context-depended properties to be exposed to the engine.
Definition at line 89 of file iquarkcomponentprovider.h.
QList<QPair<QString, QObject*> > LeechCraft::QuarkComponent::DynamicProps_ |
Dynamic properties to be exposed to the engine.
Definition at line 85 of file iquarkcomponentprovider.h.
QList<QPair<QString, QDeclarativeImageProvider*> > LeechCraft::QuarkComponent::ImageProviders_ |
Definition at line 91 of file iquarkcomponentprovider.h.
QList<QPair<QString, QVariant> > LeechCraft::QuarkComponent::StaticProps_ |
Definition at line 90 of file iquarkcomponentprovider.h.
QUrl LeechCraft::QuarkComponent::Url_ |
URL of the main QML of this file.
This file will be loaded to the corresponding declarative view via a Loader or similar methods. It can be both a local file and a remote resource.
Url_ + ".manifest" is also expected to exist, and it is a manifest file that describes the quark.
Definition at line 81 of file iquarkcomponentprovider.h.