And finally a demo about web

Posted by Thiago Macieira on December 2, 2009 · 14 comments

You know, of all the demos we released and blogged about yesterday, turns out none were really a web app. “How could this be?! How could the Trolls forget about the web?” you may be asking. (or not, I mean, no one posted anything in the blogs as of the time of writing this blog)

Say no more, here’s your web demo:

This demo is called “webscraps” and was developed by formerforever Troll Girish and his friend and business partner Roopesh. The source code, of course, is available on Labs: http://qt.gitorious.org/qt-labs/webscraps.

So what does this demo do? It allows you to create a scrap collection of webpages and websites. Often you’re interested in just the “news” section of a website that may not provide an RSS feed for you to be up-to-date. For example, you could configure it to watch blue-grey central banner of the Qt Homepage.

But that’s not it. I mean, from what I’ve described so far, we could do since Qt 4.4, with QtWebKit. No… this is really a Qt 4.6 demo. For starters, it also makes use of our Animations Framework as well as the States and Transitions one. And in order to do that, it uses QGraphicsWebView, which is also a new feature in Qt 4.6. It’s a very complete demo for what Qt can do and how you can integrate Web content into a Qt application.

Now, I tried the demo on my N900, but with WebKit in debug mode it runs painfully slow. I couldn’t run it in release mode because then it crashes (I think it’s my toolchain, though, since most QtScript unit tests also crash).

Anyone wants to give a hand? We’d like to see this running fast, so it’s a great opportunity to flex your optimisation muscles and play with the new QGraphicsWebView, Animations, States and Transitions APIs. Contributions are welcome.

Good hacking!

PS: Why it fell to me to blog about Web and Graphics View, I am not sure. Maybe they couldn’t decide who should blog (similarly as they couldn’t decide for a time if it should be called QGraphicsWebView or QWebGraphicsView). Or they thought that as a Product Manager I would have time on my hands… :-)

QShare(this)

Possibly related posts:

  1. The Qt Developer Network is finally live!
  2. QML/3D Demo
  3. QtWebKit now accelerates CSS animations & 3D transforms

14 comments

1 scorp1us December 2, 2009 at 5:42 pm
 

Well who is in who? If you’re loading Web into a Scene, then QGra*. If you’re loading Scenes into Web, then QWeb*. Or make both and typedef them equal.

I’d ask, where does the dependency lie? In QtGUI or QtWebKit?

2 sebas December 2, 2009 at 5:47 pm
 

We’ve added something similar to KDE Plasma 4.4, the webslice applet. It let’s you choose an arbitrary element of a webpage (defined by a CSS identifier or by screen coordinates) to put it on your desktop, or rather Plasma surface, whereever you’re using it.

I have to say that the webkit / qgraphicsview stuff in Qt 4.6 is quite nice and fun to play with. :)

3 eMerzh December 2, 2009 at 5:56 pm
 

@sebas: it would be cool to add the webscarps selecting method to the webslice applet… It’s a nice an easy way to take a part of a page even for dummy

4 sebas December 2, 2009 at 6:58 pm
 

Yes, sounds certainly interesting. KDE Plasma is in feature freeze right now though, so it’ll have to wait until trunk/ opens again.

5 Nils December 2, 2009 at 8:25 pm
 

This is a cool demo. But:

- On Mac OS X it’s really slow – on a very fast machine
- There are lots of rendering bugs (e.g. the ComboBox popup is below the LineEdit and ToolButton in the main toolbar)
- ComboBox popup is not even usable when the toolbar is on the upper edge of the canvas because it’s not completely visible (ok, it’s painted on the GraphicsView but that’s of no interest to the user who wants to click on an item he cannot see)
- Sometimes clicks/mousedrags seem be ignored. I cannot reproduce this, it just happens sometimes.

I’m sorry to say this but this is not a usable interface at all!

6 vpicaver December 2, 2009 at 10:13 pm
 

Are you using the Mac OS X native rendering engine? If you are, it’s horribly slow! Try adding -graphicssystem raster or -graphicssystem opengl to the arguments of the program.

7 thom December 2, 2009 at 11:07 pm
 

Are there any official plans to go the other way around ie transform qt apps in web apps.
Using a cappucino-like framework ? I have heard some quite interesting bits about Wt and QtWui.
When can we compile any Qt apps as web apps ?

8 Andrea December 3, 2009 at 1:48 pm
 

This is what happens with -graphicssystem opengl on Mac OS X. Qt 4.6 is still full of bugs (at least on Mac) … released to early
for good behavior.

QPixmap::scaleHeight: Pixmap is a null pixmap
hijackWindow() context created for MainWindow(0xbffff4b4) 1
Created Window Surface FBO QSize(950, 540) with samples 4
Debugger() was called!
2009-12-03 12:41:38.905 WebScraps[26877:10b] Cannot find executable for CFBundle 0x200263a0 (not loaded)
Bus error

9 Girish December 3, 2009 at 4:06 pm
 

There is something wrong with the commenting system. This is the third time, I am trying to add this comment.

Credit where credit is due – most of the heavylifting was done by roop.

Nils – Qt Software developers are aware of the slowness. They are working on it. The demo obviously stretches limits of webkit, qgv, animations and effects.

Andrea – I don’t have a mac with me now, but it used to work atleast with rc1.

10 roop December 3, 2009 at 6:42 pm
 

scorp1us – It was baptized QGraphicsWebView quite a while ago (Whole story: http://labs.trolltech.com/blogs/2009/09/29/updates-from-qtwebkit-land/)

Nils – Qt Software developers are aware of the slowness. They are working on it. The demo obviously stretches limits of webkit, qgv, animations and effects.

Andrea – I don’t have a mac with me right now, but it used to work atleast with Qt 4.6 of a month ago on gitorious.

11 Nils December 3, 2009 at 8:04 pm
 

@roop Regardless of speed, widgets on GraphicsView are not an option as long as basic stuff like a combobox popup is not rendered properly. I mean recently you blogged about a QGraphicsAnchorLayout. Nice thing but only usable with Widgets in QGraphicsView, which IMHO are not ready for primetime yet.

12 Dimitris December 4, 2009 at 7:26 pm
 

Nice but it would be more interesting for Qt applications to run from within web pages, like Flash and Java. I see the groundwork for such integration in QML, JavascriptCore, etc. I am hoping you are thinking about it.

13 alexis.menard December 7, 2009 at 11:28 am
 

@Nils : Look at widget NG project, at least the goals of this project…

14 Andrea Budelacci December 18, 2009 at 10:04 am
 

Hello guys,
I found this demo very nice, but I have a big question: is it possible to open an url that use flash? I tried to open youtube but this demo crash. I can open successfully the same link with midori or firefox. Do I have to move some *.so somewhere?

Andrea (Italy)

Comments on this entry are closed.

Previous post:

Next post: