Developing apps for Toon

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz

TerrorSource
Administrator
Administrator
Posts: 494
Joined: Thu May 04, 2017 9:28 pm

Re: Developing apps for Toon

Post by TerrorSource »

@hvxl

I'm testing with the local image file (2.3 in the document) but seems i cant get it working..

Logs:
file://qmf/qml/apps/xxx/xxxTile.qml:53:2: QML Image: Error transferring http://localhost/images/xxx/xxx_large.jpg - server replied: Not Found

qml file:
source: "http://localhost/images/xxx/xxx_large.jpg"

image file:
/HCBv2/qml/images/xxx/xxx_large.jpg
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Developing apps for Toon

Post by hvxl »

I just tested it again to make sure it works. This is the code I used (in directory /HCBv2/qml/apps/xxx):

XxxApp.qml:

Code: Select all

import QtQuick 2.1
import qb.base 1.0

App {
    property url tileUrl: "XxxTile.qml"

    function init() {
        const args = {
            thumbCategory: "general",
            thumbLabel: "Xxx",
            thumbIcon: "qrc:/images/unknown.svg",
            thumbIconVAlignment: "center",
            thumbWeight: 30
        }
        registry.registerWidget("tile", tileUrl, this, null, args);
    }
}
XxxTile.qml:

Code: Select all

import QtQuick 2.1
import qb.components 1.0

Tile {
    Image {
        anchors.centerIn: parent
        source: "http://localhost/images/xxx/xxx_large.jpg"
    }
}
Xxx tile screen shot
Xxx tile screen shot
toonfb0001.png (21.39 KiB) Viewed 28134 times
What happens if you try to access the file from the command line?:
cd /tmp
wget http://localhost/images/xxx/xxx_large.jpg

I'm doing this on a toon 1. I expect it works on toon 2 as well, but I don't have one to test that assumption.
Schelte
ralph123
Starting Member
Starting Member
Posts: 7
Joined: Sat Jan 11, 2020 11:51 pm

Re: Developing apps for Toon

Post by ralph123 »

I'm a newbie in building apps. I'm looking into showing the values of my SolarEdge inverter.
Is it a lot of work to build an app that shows only 1 value. SolarEdge has an api. Andy I found a pyton script. https://pypi.org/project/solaredge/

For history etc. I use the SolarEdge app. It's nice to see the current Kw/h of the solarpanels on my Toon.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Developing apps for Toon

Post by TheHogNL »

ralph123 wrote:I'm a newbie in building apps. I'm looking into showing the values of my SolarEdge inverter.
Is it a lot of work to build an app that shows only 1 value. SolarEdge has an api. Andy I found a pyton script. https://pypi.org/project/solaredge/

For history etc. I use the SolarEdge app. It's nice to see the current Kw/h of the solarpanels on my Toon.
Why not invest in a 25 euro kWh meter and then use the native solar app on the Toon? The values from the solaredge api are only updated once per 5 minutes.
Member of the Toon Software Collective
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: Developing apps for Toon

Post by glsf91 »

Sorry for deleting my previous posts, I solved them finally.

I want to test the thumbnail icon for my application.

If I try: property url thumbnailIcon: "http://localhost/nl-icon.png"
I get the error: qrc:/apps/homescreen/TileThumbnail.qml:73:3: QML Image: Failed to get image from provider: image://scaled//localhost/nl-icon.png

I know I can use above url for an image elsewhere in the app, but I want to test it for the thumbnail icon.

Is there a way to test my own thumbnail icon before it is in the TSC resource file?


Edit:
Answer: above is not possible. Has to use resourcefile for thumbnail
Post Reply

Return to “Toon Apps”