Page 1 of 2

Developing apps for Toon

PostPosted: Sat Feb 23, 2019 4:48 pm
by hvxl
I did some investigation to figure out how to develop my own Toon apps. Because more people seem to be looking for this kind of information, I turned my notes into a short manual. It is by no means complete, but should hopefully help to get aspiring developers started. I will update the document if I discover additional interesting items.

Re: Developing apps for Toon

PostPosted: Sat Feb 23, 2019 5:16 pm
by Toonz
Wish I had this when I started..... Top!

Re: Developing apps for Toon

PostPosted: Mon Jun 24, 2019 12:38 pm
by mvdbr4nd
Hi,

Thanks for this great manual. However i seem to get stuck a little. the globals.qml is no longer present in the latest firmware . 5.5.7 (toonstore works as well as the apps availible in the store). I want to create my own apps as well and used this manual. However Tile's do not show op not even with the most trivial demo project. Anyone else that has this issue with the 5.5.7 software?

The app I want to create is somewhat similar to the hass app. but this time for Pilight. or to make it more generic an App that just POST's to a URL with a json string as argument. So you can create tiles (or screen) with buttons that you can use to invoke pilight actions or other services f.e. olisto connectors.

qmlc files are not created uppon restart gui. And there is no logging :-(

Re: Developing apps for Toon

PostPosted: Mon Jun 24, 2019 2:18 pm
by Toonz
Hi,

there has been some changes since version 4.22.7 in the way Toon is starting apps.
From 4.22.7 Toon started using so called 'qml resource files' in which all qml resources are located.
We have modified the resource files in a way that also custom apps will be loaded if a number of conditions are met.
The file globalq.qml is not used for that anymore.

Our resource files will load custom apps if and only if:
- the app folder name does not contain the "-" character
- the app folder has only lowercase characters (is actually a requirement for inclusion in the ToonStore later on)
- the app folder contains a file named <FolderApp.qml>, starting with an uppercase character, example ../apps/toonstore/ToonstoreApp.qml

When meeting these requirements the resourcefile will try to start the app, results of that can be tracked in the log files (either console.log or redirect to a file).

N.B. Note that also the way images are processed has changed. Images must be included in the drawables.rcc resource file or our own resourcefile.
Best way forward when starting app development is too use one of the existing builtin images.
We can add your custom images to the resourcefiles later on....

Hope this helps.

Kind regardz,

Toonz

Re: Developing apps for Toon

PostPosted: Mon Jun 24, 2019 9:35 pm
by mvdbr4nd
I did all that but no success even a simple demoApp demoTile for some reason is doenst work on the latest firmware. Also icon I used the one also used by the buienradar app (Just for testing). Killall qt-gui should be enough right?

I'll check the logs to see if anything shows up

Re: Developing apps for Toon

PostPosted: Tue Jun 25, 2019 9:37 am
by Toonz
can you post your app here (in a zipfile)?
BTW: easiest method of logging is via the inittab:

qtqt:245:respawn:/usr/bin/startqt >/var/log/qt 2>&1

The qt log file will be started from scratch again after every gui restart.
Do not keep logging switched on for a longer period on a Toon 1 as it consumes too much available diskspace (can grow 5Mb per day easily).
But for dev purposes it works perfectly

Re: Developing apps for Toon

PostPosted: Tue Jun 25, 2019 7:41 pm
by mvdbr4nd
Thanks a lot, having some logging really helps to spot some syntax issues ;-) which indeed was the case here :roll:
Small note I did have to do a restart completely. killall qt-gui was not enough.

Anyone have any experience using QT designer for these qml files?
Does that have benefits?

Re: Developing apps for Toon

PostPosted: Mon Jul 08, 2019 4:31 pm
by hvxl
You don't have to completely restart Toon. But after editing /etc/inittab, you will have to tell the system to reload the updated inittab. This can be done with the command: init q
I have added this information to the document.

Re: Developing apps for Toon

PostPosted: Sun Jul 21, 2019 3:55 pm
by Templar
I am trying to import the module QtWebSockets 1.1

But the app doesn't load and I get the following error:
file://qmf/qml/apps/slimmemeter/SlimmemeterScreen.qml:4 module "QtWebSockets" is not installed


Is there a way to check which Qt modules are installed?

Re: Developing apps for Toon

PostPosted: Sun Jul 21, 2019 4:08 pm
by hvxl
To use websockets you have to manually install a library. See: https://www.domoticaforum.eu/viewtopic. ... 600#p89600

Toon app for flamingo switches ?

PostPosted: Thu Oct 24, 2019 12:30 am
by estate
Is there anyone who has tried to build an app to manage smart switches fromflamingo (Action retailer in the Netherlands ?

https://www.action.com/nl-nl/p/flamingo ... bediening/

This cheap stuff really works and is an afordable option to start with home domotic.

The sets are very cheap and the inside electronic can easely be dismantled and adapted onto other stuff :)

Re: Developing apps for Toon

PostPosted: Thu Oct 24, 2019 7:01 am
by TheHogNL
Not possible from the toon directly but you can use domoticz (and rfxcon) https://www.twoenter.nl/blog/domotica/p ... -domoticz/
Ofcourse, you then can switch the domoticz buttons from the Toon with the domoticzboard toon app

Re: Developing apps for Toon

PostPosted: Wed Oct 30, 2019 9:22 pm
by Paluke
Hi all,

Some great stuff here on this forum!

I've read the DevelopingToonApps manual. But I could not find anything about using the QT webengine.
I think it would be cool to be able to make a simple browser application to serve pages hosted on a machine on the local network.

Resources:
https://doc.qt.io/qt-5.12/qtwebengine-overview.html

doc.qt.io/qt-5/qtwebengine-webengine-qu ... ample.html

But since I'm not a QT developer (and have no access to that IDE) I have no idea if that is even possible. Any thoughts?

Re: Developing apps for Toon

PostPosted: Mon Nov 11, 2019 4:46 pm
by RoadXY
Is it possible to use Qt Creator ( https://www.qt.io/blog/2017/05/24/qt-cr ... 0-released ) for GUI creation?

Re: Developing apps for Toon

PostPosted: Mon Nov 11, 2019 4:59 pm
by TheHogNL
Only for easy layout testing but not more than that I am afraid. A lot of qml compontents used in the Toon are custom made (or extended on top of existing ones). But yes, it is possible to create a nice layout using qt creator and then translate that into your toon custom app code.