Thiago Macieira
Qt
WebKit
Performance
Posted by Thiago Macieira
 in Qt, WebKit, Performance
 on Wednesday, December 02, 2009 @ 14:55

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… :-)

14 Responses to “And finally a demo about web”

» Posted by scorp1us
 on Wednesday, December 02, 2009 @ 15:42

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?

» Posted by sebas
 on Wednesday, December 02, 2009 @ 15:47

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. :)

» Posted by eMerzh
 on Wednesday, December 02, 2009 @ 15:56

@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

» Posted by sebas
 on Wednesday, December 02, 2009 @ 16:58

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

» Posted by Nils
 on Wednesday, December 02, 2009 @ 18:25

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!

» Posted by vpicaver
 on Wednesday, December 02, 2009 @ 20:13

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.

» Posted by thom
 on Wednesday, December 02, 2009 @ 21:07

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 ?

» Posted by Andrea
 on Thursday, December 03, 2009 @ 11:48

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 0×200263a0 (not loaded)
Bus error

» Posted by Girish
 on Thursday, December 03, 2009 @ 14:06

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.

» Posted by roop
 on Thursday, December 03, 2009 @ 16:42

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.

» Posted by Nils
 on Thursday, December 03, 2009 @ 18:04

@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.

» Posted by Dimitris
 on Friday, December 04, 2009 @ 17:26

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.

» Posted by alexis.menard
 on Monday, December 07, 2009 @ 09:28

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

» Posted by Andrea Budelacci
 on Friday, December 18, 2009 @ 08:04

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)



© 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners.