Would it be nice if we can see the preview of a web page before we actually visit it? Apparently browser add-ons and WordPress plugin that implement this feature do exist. Some of them rely on the server-side solution to create the preview, others do that right at the client-side. The server-side solution might be faster because it can cache some of popular web sites, however it might trouble some people who care a lot for privacy.
The example today demonstrates a nice usage of QtWebKit to generate the web thumbnail. Basically it grabs the content of the web page, renders to an image, scales the image to the intended size, and then saves the result. Could not be easier, could it?
svn checkout svn://labs.trolltech.com/svn/graphics/dojo/websnap
cd websnap && qmake && make
After it is built, an easy example would be:
./websnap www.trolltech.com trolltech.png
And then check out the output file!
Exercise for the reader: this tool renders everything and thus could be really slow for a big page (think of Digg). For a previewer, typically you just want some part of the beginning of the a very long page. Thus, the challenge is to modify the program to actually do a progressive rendering and stop if necessary.
Download the latest release here: www.qt.io/download.
Qt 6 was created to be the productivity platform for the future, with next-gen 2D & 3D UX and limitless scalability.
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Näytä tämä julkaisu Instagramissa.
Want to build something for tomorrow, join #QtPeople today! We have loads of cool jobs you don’t want to miss! http://qt.io/careers #builtwithQt #software #developers #coding #framework #tool #tooling #C++ #QML #engineers #sales #tech #technology #UI #UX #CX #Qt #Qtdev #global #openpositions #careers #job
Henkilön Qt (@theqtcompany) jakama julkaisu