[SailfishDevel] My sailfishapplication-less setup/project (which enables the use of setContext*)
jonni.rainisto at jollamobile.com
Sun Jul 21 12:08:50 UTC 2013
thanks for the feedback.
And yes in next beta SDK I've added createView() and setView functions to sailfishapplication SDK template, which allows you to call setContextProperty etc functions in between before loading the QML main page. And also added support in template to have main.qml in qrc-resource file. So template will be more QML/C++ friendly in next SDK release.
From: devel-bounces at lists.sailfishos.org [devel-bounces at lists.sailfishos.org] on behalf of Superpelican [superpelican at zoho.com]
Sent: Saturday, July 20, 2013 6:33 PM
To: devel at lists.sailfishos.org
Subject: [SailfishDevel] My sailfishapplication-less setup/project (which enables the use of setContext*)
Building on my custom main.cpp which I've showed earlier, I've created a sailfishapplication project less project. Which allows you to use the setContext* methods which are useful for QML/C++ communication/integration. I now also have a custom .pro file, which has the sailfishapplication.* stuff removed and has the necessary stuff that was previously in sailfishapplication.pri integrated. My custom main.cpp and .pro are in the tar.gz archive attachment. I hope this is useful for other SailfishDevel list members and saves them some work ;). Of course you will need to edit the "TARGET", "desktop.files" and "OTHER_FILES" sections to match your app's name and edit the "SOURCES" and "HEADERS" sections according to the .cpp's and .hpp's/.h's your project contains.
My project tree now looks like:
(Sorry for the bad tree, I'm no ASCII art pro ;) )
The whole sailfishapplication project is left out completely as you can see in the tree, no unnecessary stuff left :)
Maybe Jolla can include 2 separate SailfishOS application templates in the beta SDK, one "SailfishOS QML only application" template and a "SailfishOS Qt Quick/C++ application" template (with a special main.cpp that allows the use of setContext* like my main.cpp and custom .pro like mine) :) that would be really handy. Especially because Jolla suggest on sailfishos.org that Sailfish apps are written in a mixture of QML and C++. So IMHO they should have a QML/C++ friendly template ;)
Also some links on sailfishos.org to the Qt-project Wiki's pages about QML/C++ communication/integration would be welcome (or additional documentation written by Jolla :) ). As like I said above Jolla suggests that Sailfish apps are written in a QML/C++ mixture, while (almost) all of the documentation or links to documentation on Qt-project.org on sailfishos.org is QML only.
I hope this useful for the other SailfishDevel list members and my feedback is useful for Jolla :) And thanks for all the help I got on this list and for all the awesome work the Jolla guys and women are doing :), keep up the good work! ;),
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel