![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Describes a single quark. More...
#include "iquarkcomponentprovider.h"
Public Member Functions | |
QuarkComponent ()=default | |
Initializes a null quark component. More... | |
QuarkComponent (QuarkComponent &&other)=default | |
Move-constructs this quark component from other. More... | |
QuarkComponent & | operator= (QuarkComponent &&other)=default |
Move-assigns this quark component from other. More... | |
QuarkComponent (const QString &subdir, const QString &filename) | |
Initializes a quark component for the given file path. 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... | |
std::vector< std::pair< QString, std::unique_ptr< QObject > > > | ContextProps_ |
Context-depended properties to be exposed to the engine. More... | |
QList< QPair< QString, QVariant > > | StaticProps_ |
Statis properties to be exposed to the engine. More... | |
QList< QPair< QString, QQuickImageProvider * > > | ImageProviders_ |
The image providers to be exposed to the engine. More... | |
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 50 of file iquarkcomponentprovider.h.
|
default |
Initializes a null quark component.
|
default |
Move-constructs this quark component from other.
The other quark component is in unspecified state after the move and can only be destructed.
[in] | other | The quark component to move from. |
|
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 125 of file iquarkcomponentprovider.h.
|
default |
Move-assigns this quark component from other.
The other quark component is in unspecified state after the move and can only be destructed.
[in] | other | The quark component to move from. |
std::vector<std::pair<QString, std::unique_ptr<QObject> > > LC::QuarkComponent::ContextProps_ |
Context-depended properties to be exposed to the engine.
Definition at line 70 of file iquarkcomponentprovider.h.
QList<QPair<QString, QObject*> > LC::QuarkComponent::DynamicProps_ |
Dynamic properties to be exposed to the engine.
Definition at line 66 of file iquarkcomponentprovider.h.
QList<QPair<QString, QQuickImageProvider*> > LC::QuarkComponent::ImageProviders_ |
The image providers to be exposed to the engine.
The list contains pairs of a QString and an image provider. Each image provider is added to the engine under the name in the corresponding QString upon addng the quark to the view.
Definition at line 85 of file iquarkcomponentprovider.h.
QList<QPair<QString, QVariant> > LC::QuarkComponent::StaticProps_ |
Statis properties to be exposed to the engine.
These properties are set once upon adding quark to a view, and they are not modified further.
Definition at line 77 of file iquarkcomponentprovider.h.
QUrl LC::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 62 of file iquarkcomponentprovider.h.