[webkit-qt] QWebView copy shortcut problem

Caio Marcelo de Oliveira Filho caio.oliveira at openbossa.org
Fri Jun 3 07:29:45 PDT 2011

Hello Harri,

I made a small self-contained example based on your code and tried to
Copy using the shortcut and the context menu:

#include <QDebug>
#include <QtGui>
#include <QtWebKit>

int main (int argc, char* argv[])
    QApplication app(argc, argv);

    QWebView view;
    view.setHtml("<html><body>Try Ctrl+C copy text, does not

    QAction* action = view.pageAction(QWebPage::Copy);
    qDebug() << action << action->shortcut() << QWebPage::Copy;

    qDebug() << action << action->shortcut();

    return app.exec();

> The copy works when invoked through the right click menu on marked region, but
> not when using the set shortcut (which appears in menu).

I tested and it indeed doesn't work with the QtWebKit version shipped
in Qt 4.7.x. However both trunk and 2.2 branch work as expected.


Caio Marcelo de Oliveira Filho
OpenBossa - INdT

More information about the webkit-qt mailing list