Ask / Submit
10

Sailfish SDK: Requesting well documented C++ and QML tutorial

asked 2015-03-04 21:11:37 +0200

MikErk gravatar image

updated 2015-03-06 09:39:03 +0200

eric gravatar image

Hello everyone,

I am trying to do my first steps with the sailfish sdk. I've gone trough the examples and I still can't really figure out how to get c++ and qml connected between each other. I have read and gone through what was posted here https://together.jolla.com/question/272/is-there-proper-c-qml-example/ but as I am newbie (I know c++, but never used Qt or QML so far) it is pretty hard to understand that stuff. Also when you look at http://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html#connecting-to-qml-signals, this all seems so simple but in the SDK I don't get that to work.

Until now I've always tried to open a new sailfish project, add an item (with signal to c++) to the firstpage.qml and try to talk with it via C++...basically the chapter "Connecting to QML Signals" from the QT website.

Is there any good developer resource or forum out there? I'll already heard from the sailfish-devel mailing list, which I probably will join soonly. Otherwise please add some good comments to the examples in the SDK or describe them on the Sailfish website. Especially there should be another example besides "signal.pro", showing how to incorporate c++ with qml in SilicaStyle Sailfish UI. I think that this could really make a difference for beginners and therefore encourage more to contribute to this project

Cheers Mika

edit retag flag offensive close delete

Comments

2

Hi Mika, you can look at my code. It is neither perfect nor complete, but the code works and is simple enough to understand...

https://github.com/mixalturek/harbour-stator/blob/master/qml/pages/SportPage.qmlhttps://github.com/mixalturek/harbour-stator/tree/master/src

Michal Turek ( 2015-03-04 22:20:47 +0200 )edit

Thx Michal, I'll have a look at it

MikErk ( 2015-03-04 22:32:37 +0200 )edit
1

I have had the same problem. Didn't understand how to combine c++, qml and Silica. A really simple example would be helpfull! Will check Michal's code at some point.

pekkeli ( 2015-03-05 09:13:07 +0200 )edit
1

Forget Silica and focus on Qt. Silica is only a custom SailfishOS library based on Qt. You can always start with general C++/Qt/qml tutorials.

google.com "qml c++" http://qt-project.org/doc/qt-4.8/qml-extending-tutorial-index.html

Michal Turek ( 2015-03-05 09:43:29 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2015-03-04 22:39:15 +0200

Fuzzillogic gravatar image

You might want to have look at QmlBook. While not directly targeting Sailfish, it looks like a very interesting primer in QML, Qt and C++. Many if not all the concepts are applicable on Sailfish as well. The last commit was two hours ago, so it's again actively developed.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2015-03-04 21:11:37 +0200

Seen: 1,152 times

Last updated: Mar 04 '15