Developing apps for Toon

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz

hvxl
Senior Member
Senior Member
Posts: 1756
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Developing apps for Toon

Post 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.
Attachments
DevelopingToonApps.pdf
Updated: Jul 8, 2019
(195.39 KiB) Downloaded 1139 times
Last edited by hvxl on Mon Jul 08, 2019 5:26 pm, edited 1 time in total.
Schelte
Toonz
Forum Moderator
Forum Moderator
Posts: 1769
Joined: Mon Dec 19, 2016 1:58 pm

Re: Developing apps for Toon

Post by Toonz »

Wish I had this when I started..... Top!
member of the Toon Software Collective
mvdbr4nd
Starting Member
Starting Member
Posts: 12
Joined: Mon Jun 24, 2019 1:29 pm

Re: Developing apps for Toon

Post 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 :-(
Toonz
Forum Moderator
Forum Moderator
Posts: 1769
Joined: Mon Dec 19, 2016 1:58 pm

Re: Developing apps for Toon

Post 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
member of the Toon Software Collective
mvdbr4nd
Starting Member
Starting Member
Posts: 12
Joined: Mon Jun 24, 2019 1:29 pm

Re: Developing apps for Toon

Post 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
Toonz
Forum Moderator
Forum Moderator
Posts: 1769
Joined: Mon Dec 19, 2016 1:58 pm

Re: Developing apps for Toon

Post 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
member of the Toon Software Collective
mvdbr4nd
Starting Member
Starting Member
Posts: 12
Joined: Mon Jun 24, 2019 1:29 pm

Re: Developing apps for Toon

Post 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?
hvxl
Senior Member
Senior Member
Posts: 1756
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Developing apps for Toon

Post 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.
Schelte
Templar
Member
Member
Posts: 177
Joined: Fri Mar 18, 2011 8:49 pm
Location: Netherlands

Re: Developing apps for Toon

Post 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?
hvxl
Senior Member
Senior Member
Posts: 1756
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Developing apps for Toon

Post by hvxl »

To use websockets you have to manually install a library. See: viewtopic.php?f=103&t=12332&p=89600#p89600
Schelte
estate
Starting Member
Starting Member
Posts: 20
Joined: Tue Oct 22, 2019 11:56 pm

Toon app for flamingo switches ?

Post 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 :)
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2112
Joined: Sun Aug 20, 2017 8:53 pm

Re: Developing apps for Toon

Post 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
Member of the Toon Software Collective
Paluke
Starting Member
Starting Member
Posts: 1
Joined: Wed Oct 30, 2019 10:16 pm

Re: Developing apps for Toon

Post 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?
RoadXY
Member
Member
Posts: 111
Joined: Wed Oct 21, 2015 8:11 am

Re: Developing apps for Toon

Post by RoadXY »

Is it possible to use Qt Creator ( https://www.qt.io/blog/2017/05/24/qt-cr ... 0-released ) for GUI creation?
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2112
Joined: Sun Aug 20, 2017 8:53 pm

Re: Developing apps for Toon

Post 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.
Member of the Toon Software Collective
Post Reply

Return to “Toon Apps”