Remember the tradition that I started in Redwood City? Well, the parallax sliding demo was for the graphics talk. For my QtWebKit presentation, the challenge was different. Basically it boils down to a visual version of Google Search. Instead only getting the hits and some text snippet, you should also get the web snapshot of the hits. There are apparently browser extensions out there which implement this kind of functionality.
Before going further, let us see first how we can get a preview of any web page. With QtWebKit, it is as easy as creating a QWebPage and using it to render the content to a painter that operates on an image. Check out websnap example, if you think this is not easy enough. Running websnap to several popular web sites gives the following:
Coming back to visual search. So while rehearsing my talk in the night before, I created the search and snap demo. What is presented as the next dojo example is however a slightly better version (afterall, I have more than just one night to polish it), as I added some text snippet to make it more attractive. The result is as follows, the code can be checkout from the usual graphics corner. As you can see, a third of the code is just reusing the WebSnap class.
A screencast is worth a thousand screenshots. Thus, for your pleasure, check the following 1-minute video, too. Or view it on blip.tv (high quality), YouTube (low quality, more bandwidth-friendly), or download the Ogg Theora file (3.3 MB).
So who is going to turn it into a plasmoid?