maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [ANNOUNCE] Quick Widgets 0.3.2 - quickly deploy qt quick as widgets (https://talk.maemo.org/showthread.php?t=65769)

GreatGonzo 2010-11-17 12:17

[ANNOUNCE] Quick Widgets 0.3.2 - quickly deploy qt quick as widgets
 
2 Attachment(s)
Hi all,

I had a stab at my first application - called quick-widgets. It allows to run Qt Quick applications (qml files) as desktop (hildon-home) widgets. The code is heavily based on venemo's q-extras and sticky notes. So A BIG THANKS for doing all the hard work.

There are plenty of qml examples out there you can use., e.g. http://doc.qt.nokia.com/qt-maemo-4.7...eexamples.html


Features
  • as said - run qml applications as widgets
  • similar to qmlviewer, provide
    Code:

    runtime.isActiveWindow
    to suspend the widget.
  • use the size of the qml application or specify custom size which will scale the qml if programmed to allow it
  • as sticky-notes, restore all widgets on reboot
  • access to QProcess qml wrapper, see example in /opt/quick-widgets/examples
  • dynamically resize widget to content size
  • support from qt mobility v0.2.3
  • add widgets from command-line v0.2.5
  • make widget auto-rotate with the phone orientation (customisable) v0.3.0

Usage
  • enable extras-devel and install
  • start the application to each time you want to add a new widgets
  • select a qml file
  • optionally give it a fixed size which will scale the widget
  • optionally enable auto-rotation of the widget

To Do
  • listen to feedback :D

I am looking forward to people posting their useful widgets.

Examples
I have attached the source for building the qml Process plugin. I am using this on my Desktop for creating widgets under Qt SDK 1.1. See README for very basic instructions.

MJGibb 2010-11-17 13:49

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Sorry - I know this goes back a couple of steps on your post, but how do I go from http://doc.qt.nokia.com/qt-maemo-4.7...otoviewer.html looking longingly at this qml demo of a photo viewer app to getting it on my phone as a demo?

cfh11 2010-11-17 13:53

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
FYI the link has an extra "http" in it

maddude 2010-11-17 21:42

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by GreatGonzo (Post 876005)
Hi all,

I had a stab at my first application - called quick-widgets. It allows to run Qt Quick applications (qml files) as desktop (hildon-home) widgets. The code is heavily based on venemo's q-extras and sticky notes. So A BIG THANKS for doing all the hard work.

There are plenty of qml examples out there you can use., e.g. http://http://doc.qt.nokia.com/qt-ma...eexamples.html


Features
  • as said - run qml applications as widgets
  • similar to qmlviewer, provide
    Code:

    runtime.isActiveWindow
    to suspend the widget.
  • use the size of the qml application or specify custom size which will scale the qml if programmed to allow it
  • as sticky-notes, restore all widgets on reboot

Usage
  • Download the deb - I still have to put it in extras-devel.
  • install dependencies -
    Code:

    apt-get install q-extras libhildon-extras1
  • install quick-widgets -
    Code:

    dpkg -i quick-widgets_0.1.0_armel.deb
  • start the application to add new widgets

To Do
  • write qml bindings to system calls
  • support custom c++ bindings
  • listen to feedback :D

I am looking forward to people posting their useful widgets.

ok how do o get widgets working, for example i would like to have that web browser as a widget, but how ?

GreatGonzo 2010-11-17 22:06

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by MJGibb (Post 876068)
Sorry - I know this goes back a couple of steps on your post, but how do I go from http://doc.qt.nokia.com/qt-maemo-4.7...otoviewer.html looking longingly at this qml demo of a photo viewer app to getting it on my phone as a demo?

This application is for use of qml as desktop widgets. If you want to run qml as separate applications you can use the qmlviewer which is in the package qt4-declarative-qmlviewer. Then just run the qmlviewer and load the qml file.

This might be worth packaging up son one can easily create their own application wrappers as well.

mece 2010-11-17 22:13

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
great stuff. Any particular reason this isn't in devel?

GreatGonzo 2010-11-17 22:19

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Yep - I didn't have time to set it up yet. Small children can be a pain and the wife wants some attention too ;)

GreatGonzo 2010-11-17 22:24

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by maddude (Post 876458)
ok how do o get widgets working, for example i would like to have that web browser as a widget, but how ?

Probably not a good idea as this is full screen :eek: Use the qmlviewer for this. My application is mainly targeted at widgets.

I will post an example of a widget which shows a webpage and updates it periodically soon.

mece 2010-11-17 22:29

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by GreatGonzo (Post 876492)
Yep - I didn't have time to set it up yet. Small children can be a pain and the wife wants some attention too ;)

Haha Yep, you're preaching to the quire :)

PS you could have uploaded to extras in the time it took to post that reply... ;)
dpkg-buildpackage -sn -S -rfakeroot
https://garage.maemo.org/extras-assi...dex.php?step=2

GreatGonzo 2010-11-17 23:03

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Thanks! Done now. Digging through the docs and applying for upload permissions takes some time though. It isn't really the most transparent process. Hence me creating a package to make things easier from qml widgets

GreatGonzo 2010-11-17 23:38

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
mece,

Is the root user error of relevance?

https://garage.maemo.org/builder/fre....0/summary.log

mece 2010-11-18 08:19

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by GreatGonzo (Post 876567)
mece,

Is the root user error of relevance?

https://garage.maemo.org/builder/fre....0/summary.log

hmm.. no idea. Lemme try to install it.

EDIT: Seems to work just fine.
EDIT2: Tested with my magical spinning Deathspell Omega logo, and it worked very well. Awesome stuff! Prepare for lots of useless stuff!

GreatGonzo 2010-11-20 09:05

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Here we go. a webpage view as a widget...

save it to home or MyDocs
rename to webpage.qml
load it into quick-widgets

You can edit the url field and make as many copies and instances as you want. I will also add a reload timer if wanted.

maddude 2010-11-20 09:54

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
nice nice nice, look at that, a web browser widget, bloody awesome mate .
just one question is it hard to get that .qml file ?

maddude 2010-11-20 10:52

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by GreatGonzo (Post 878612)
Here we go. a webpage view as a widget...

save it to home or MyDocs
rename to webpage.qml
load it into quick-widgets

You can edit the url field and make as many copies and instances as you want. I will also add a reload timer if wanted.

mate this is awesome, can you please please add scrolling to i so i can scrool up or down in the webpage, and yes a reload timer would be awesome, this can be the best facebook/twitter/google widget ever .

GreatGonzo 2010-11-20 13:10

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
1 Attachment(s)
ok here is an improved version:

You can set the update/reload interval at the top of the script
You can scroll by tapping on the right hand side of the widget - top half scroll up/ bottom half scroll down.

Off to bed - wife is complaining :p

maddude 2010-11-20 13:38

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
lmao, all of us have problems with our n900 and our girlfriend/wife, they just don't agree .

maddude 2010-11-20 14:01

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
and scrolling isn't working .

GreatGonzo 2010-11-20 20:38

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Are you sure you replaced the old one. You need to remove the widget and load the file again...

maddude 2010-11-20 21:20

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
wait wait, the problem was that i was using it with touch.facebook.com before signing in, for some reason it didn't work, but now after signning in the scrolling is working perfectly, man you app might be the solution to all the problems we had with widgets, i mean we might end up getting a facebook status update widget, or a widget that displays a contatc's last twitter/fb update (still trying to figure out this one, no website that shows the last status update of a contact :( maybe i got to find my way arround here )

etuoyo 2010-11-20 21:34

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Don't have my N900 out so can't try this out now but would someone be a hero and explain to me what a web widget does? It shows a web page with you being able to set size as well as how often it refreshes?

maddude 2010-11-20 22:59

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
yes thats pretty much it, you can scroll up/down and browser normally like you do from a browser, and u can use the keyboard for input, its a web browser widget .

GreatGonzo 2010-11-22 04:25

Re: [ANNOUNCE] Quick Widgets 0.2.0 - quickly deploy qt quick as widgets
 
quick-widgets-0.2.0 has been uploaded. The new features are:
  • access to QProcess qml wrapper, see example in MyDocs/quick-widgets/examples
  • dynamically resize widget to content size

This basically means any system command output can be accessed. So this is in alternative to the Desktop Command execution widget and/or beecons.

GreatGonzo 2010-11-22 05:09

Re: [ANNOUNCE] Quick Widgets 0.2.0 - quickly deploy qt quick as widgets
 
quick-widgets-0.2.1 has a fix to the installer.

GreatGonzo 2010-11-22 23:51

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
1 Attachment(s)
here is the first useful example
It displays memory info. Note that it updates very rapidly. You can change it to your liking.

* download attachment
* unzip it
* start quick-widgets and load meminfo.qml from the labelexample folder.

yosarian 2010-11-23 18:37

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
Great work, congratulations to the author. I see a lot of potential here.

fpp 2010-11-23 19:13

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by GreatGonzo (Post 876478)
This application is for use of qml as desktop widgets. If you want to run qml as separate applications you can use the qmlviewer which is in the package qt4-declarative-qmlviewer. Then just run the qmlviewer and load the qml file.

Sorry for the off-topic, but where does one find that package with the qmlviewer ? I don't see it anywhere...

GreatGonzo 2010-11-23 22:22

Re: [ANNOUNCE] Quick Widgets - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by fpp (Post 881423)
Sorry for the off-topic, but where does one find that package with the qmlviewer ? I don't see it anywhere...

it should bed in the main repository.

Code:

apt-cache policy  qt4-declarative-qmlviewer 
qt4-declarative-qmlviewer:
  Installed: 4.7.0~git20100909-0maemo1+0m5
  Candidate: 4.7.0~git20100909-0maemo1+0m5
  Version table:
 *** 4.7.0~git20100909-0maemo1+0m5 0
        500 https://downloads.maemo.nokia.com ./ Packages
        100 /var/lib/dpkg/status

If you can't find it in the package manager try the command-line.
in a terminal type:
Code:

sudo gainroot
apt-get install qt4-declarative-qmlviewer


GreatGonzo 2010-11-23 22:30

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by yosarian (Post 881380)
Great work, congratulations to the author. I see a lot of potential here.

yep that's why I didi it. With more qt mobility qml bindings it would be even better.

If anybody can think of a widget I can have a go at it. The main constraint is that it should be limited to tap actions as the home screen scrolling is taking over dragging or flicking.

The main highlights of qml are ease of use and animation eye candy.

I will have a look at passing on orientation events to qml so the widgets could be working in portrait mode.

GreatGonzo 2010-11-24 01:38

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
2 Attachment(s)
Here is a better version of the web browser widget:

To scroll you have to tap on the right hand side of the widget. Upper half scrolls up , lower half down. Note that this prevents from clicking any links in that area (30 pixels)

It defaults to a facebook touch view.
Either cut-n-paste this code into a file named 'webwidget.qml'
or save the attached file (note it has to be renamed or saved as webwidget.qml as this site doesn't allow qml extensions).

Then load into quick widget.

Code:

import Qt 4.7
import QtWebKit 1.0

Item {
    // Modify these to customize

    // widget width
    width: 300

    // widget height
    height: 350

    // the url to display
    property string url: "http://touch.facebook.com"

    // the optimum width for the website. The page is scaled down
    // from this width to the widget's width
    property int optimal_width: 340

    // interval when to reload the page
    // setting it to 0 means never refresh
    property real reload_in_minutes: 10

    // end user mods.

    id: main
    MouseArea {
              anchors.right: parent.right
          width: 30
          height: parent.height
          onClicked: {
          }
    }

    Rectangle {
        anchors.fill: parent
        radius: 10
        color: "gray"
        opacity: 0.6
    }

    Text {
        id: txt
        anchors.centerIn: parent
        text: "loading..."
        color: "white"
    }   

    WebView {
              id: browser
          transformOrigin: Item.TopLeft
          property bool scaled: false

          smooth: true
          visible: false
          preferredWidth: optimal_width
          preferredHeight: parent.height
          url: parent.url
          Behavior on y  { PropertyAnimation {} }
          onUrlChanged: {
              y = 0
          }
          onLoadFinished: {
              if (!scaled) {
                  browser.contentsScale = main.width/browser.width
                  scaled = true;
              }
              browser.visible = true
              //console.log('loaded')
              txt.z = 0
        }
      }


    MouseArea {
              anchors.right: parent.right
          width: 30
          height: parent.height
          onClicked: {
            var inc = main.height*0.9
            if (mouse.y > main.height/2) {
                var dy = Math.min(inc,
                          browser.contentsSize.height-main.height+browser.y)
                browser.y -= dy
            } else {
                var dy = Math.min(inc, Math.abs(browser.y))
                browser.y += dy
            }
          }

    }

    Timer {
                id: refresh
                interval: 1000*60*parent.reload_in_minutes
          running: runtime.isActiveWindow
          repeat: true
          onTriggered: { txt.z = 1
                          browser.reload.trigger()
                          }
    }

}


yosarian 2010-11-24 12:42

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
GreatGonzo, is there any way to auto sign in with touch.facebook.com? Every time I restart my device the widget requires me to sign in again. The scrolling sometimes messes up too, going too far up or down and leaving a blank area in the widget. I've reduced the amount the widget scrolls to fine-tune the amount of empty space, but doesn't solve the underlying problem.

AgogData 2010-11-24 12:56

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
@yosarian : why don't you add bookmark (touch.facebook.com), i think that what Quick Widgets do if im right

yosarian 2010-11-24 13:14

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by AgogData (Post 882020)
@yosarian : why don't you add bookmark (touch.facebook.com), i think that what Quick Widgets do if im right

Sorry I don't understand? I've changed the script to touch.facebook.com, but it requires me to sign in in the widget (which works, but is just annoying) every time I boot my device.

GreatGonzo 2010-11-24 22:39

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
To suspend javascript when the widget is not visible use:

Code:

          settings.javascriptEnabled: runtime.isActiveWindow
in the
Code:

WebView {
part

GreatGonzo 2010-11-24 22:47

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by yosarian (Post 882006)
GreatGonzo, is there any way to auto sign in with touch.facebook.com? Every time I restart my device the widget requires me to sign in again. The scrolling sometimes messes up too, going too far up or down and leaving a blank area in the widget. I've reduced the amount the widget scrolls to fine-tune the amount of empty space, but doesn't solve the underlying problem.

Sorry, I don't think so. This would need hand coding.

yosarian 2010-11-25 13:33

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by GreatGonzo (Post 882468)
Sorry, I don't think so. This would need hand coding.

Into the widget script or the software?

AgogData 2010-11-27 08:43

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
so, i can have this in my desktop ? http://doc.qt.nokia.com/qt-maemo-4.7...ive-snake.html

carlon 2011-02-02 19:24

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
Congrats to GreatGonzo, this app is very witty

festivalnut 2011-02-02 19:39

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by yosarian (Post 882957)
Into the widget script or the software?

i imagine the script would have to point to your cookies folder somehow, thus auto sign in like with microB would be possible. but i'm just guessing. dont ask me how to make it point anywhere, cos unless the answer is draw a big ascii arrow i dont know jack. :/

EDIT: unless facebook sign in supports the web address tyoe sign in.... e.g. username:password@webaddress.com in the url field, then you would just need to edit the url in the script to have your username and password. again, just guessing, test for yourself!

dbrodie 2011-02-02 21:18

Re: [ANNOUNCE] Quick Widgets 0.2.1 - quickly deploy qt quick as widgets
 
Quote:

Originally Posted by yosarian (Post 882030)
Sorry I don't understand? I've changed the script to touch.facebook.com, but it requires me to sign in in the widget (which works, but is just annoying) every time I boot my device.

You could also hook into when the website does the login and read from the DOM the username and password and save it in the offline storage, and load it back into the dom next time. ( if you need help interfacing with the dom tell me, i've already done something like this)

another option is to build the POST request properly but I am not sure how easy that is to do in the qml webview.

Be advised that both options are a bit on the gray area with regards to the facebook "no screen scrapping" policy...


All times are GMT. The time now is 17:46.

vBulletin® Version 3.8.8