Important: Please read the Qt Code of Conduct -

Copy image to clipboard

  • I have and img element in the page of qtwebkit which i want to copy to my clipboard.

    QWebPage::CopyImageToClipboard seems like what i want bit i don't know what to do.....

  • Get "QAction":/doc/qt-5.0/qtwidgets/qaction.html pointer to the "WebAction":/doc/qt-5.0/qtwebkit/qwebpage.html#WebAction-enum of type CopyImageToClipboard from "QWebPage::action()":/doc/qt-5.0/qtwebkit/qwebpage.html#action, connect "signal":/doc/qt-5.0/qtcore/signalsandslots.html "triggered":/doc/qt-5.0/qtwidgets/qaction.html#triggered of this "QAction":/doc/qt-5.0/qtwidgets/qaction.html to your custom "slot":/doc/qt-5.0/qtcore/signalsandslots.html

    Edit: made the post a bit more readable by using relative URLS instead of full URLS; Andre

  • Thank you for the response but my intention is to copy images loaded in the browser automatically.
    no user will interact with webkit.

    could you post some pseudo code?

  • Please describe your situation more clearly.... What exactly do you want and how do you imagine the workflow. You can't copy all images to the clipboard on windows, because windows clipboard can contain only one mime-object at the moment.

    if you simply want to scratch all images of web page, you can for example subclass QNAM and sniff it responses for image mime-types...

Log in to reply