Some help for recreating the Plasma Tool Box in QML

Aaron J. Seigo aseigo at kde.org
Thu Oct 27 10:12:50 UTC 2011


On Wednesday, October 26, 2011 21:26:12 Mark wrote:
> Oh and what do i do with my qml files?
> I guess i make them in plasma/desktop/shell/qml <-- new folder
> But where do i need to "install" them in cmake?

the best thing to do is it to put them into a Plasma Package and install them 
in the usual location; then you can use Plasma::Package from the C++ code to 
fetch the qml for you.

a good example of this can be found in the kde:plasma-mobile repository.

in there is a subdirectory called qmlpackages with, well, packages of qml 
stuff (along with the CMakeLists.txt that installs them).

then if you look in shell/mobcorona.cpp in the MobCorona::init() method, you 
can see usage of Plasma::Package that loads such a package:

    Plasma::PackageStructure::Ptr structure = 
Plasma::PackageStructure::load("Plasma/Generic");
    m_package = new Plasma::Package(QString(), homeScreenPath, structure);

hth..

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20111027/414f4707/attachment.sig>


More information about the Plasma-devel mailing list