Guidance needed in capturing Web page snapshot and session management



  • Hi,

    I am bit new to QT and don't have full idea of its capabilities. I request you to help me in understanding the same.

    I am planning to write an application which will use a web renderer engine (a dll) and a session manager to manage session/connection (a dll) with the server.

    I would like my renderer engine to give a bmp file of the content it gets from the server (HTML/flash) to the application. After doing lot of google search, I came to know that it is possible by using QTWebkit (though not clear of the 'How' part).

    What I would like to know is,

    1. Does QTWebkit support flash? I mean if the content from the server contains the flash data, would it be possible to take the snapshot of that and give the bmp file using QTWebkit?

    2. If I render the output of the renderer engine to a window created by my application, will the mouse and keyboard events (happening on the window) be handled by the QTWebkit? Or do we need to do anything here for the same?

    3. Do we have any support for session manager mentioned above? After searching in google, I came across the QtSoapMessage and QtSoapHttpTransport. Are these sufficient or do we have more useful component to achieve the same?

    Please do the needful. Any help would be appreciated.

    Thanks in advance.

    Regards,
    GoGetIt



  • think you posted this twice :) ... http://developer.qt.nokia.com/forums/viewthread/508



  • Duplicate post is removed now.



  • 1 - Yes, it does support flash.
    2 - QWebView is the widget who will handle the mouse/keyboard events and pass it to webkit.



  • 1 - part 2, Yes, it is possible to capture that as a bmp, by grabbing the window as below.

    @
    QPixmap pix(QPixmap::grabWindow(QApplication::desktop()->winId()));
    // Or you can use the below line too
    // QPixmap pix(QPixmap::grabWindow(ui->webView->winId()));
    pix.save("C:/Users/webview.bmp");
    @
    This was what you were looking for?

    For some reason (yet to figure out), grabbing widget does not work and the flash plugin doesn't show up in the captured image
    @
    // below does not capture the flash plugin
    QPixmap pix(QPixmap::grabWidget(ui->webView));
    pix.save("C:/Users/webview.bmp");
    @



  • bq. 1) Does QTWebkit support flash? I mean if the content from the server contains the flash data, would it be possible to take the snapshot of that and give the bmp file using QTWebkit?

    Yep. Contrary to chetankjain, I would suggest you to use QGraphicsWebView to do the rendering. This forces flash to use windowless mode (look at "http://blog.forwardbias.in/2009/12/flash-in-qgraphicsview.html":http://blog.forwardbias.in/2009/12/flash-in-qgraphicsview.html for more info).

    bq. 2) If I render the output of the renderer engine to a window created by my application, will the mouse and keyboard events (happening on the window) be handled by the QTWebkit? Or do we need to do anything here for the same?

    No idea what you mean there. If you show a QWebView, all the events are forwarded to the QWebPage, which in turn forward that to the right parts of WebKit

    bq. 3) Do we have any support for session manager mentioned above? After searching in google, I came across the QtSoapMessage and QtSoapHttpTransport. Are these sufficient or do we have more useful component to achieve the same?

    Your questions is too vague to be answered. A session could be as simple as a tcp connection, or as messy as REST API with session id shared by the server and client.



  • bq.
    look at http://blog.forwardbias.in/2009/12/flash-in-qgraphicsview.html for more info).

    nice link, thanks :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.