[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:

--->8---
#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
work</body></html>");

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

    action->setShortcut(QKeySequence::Copy);
    qDebug() << action << action->shortcut();

    view.show();
    return app.exec();
}
----8<---

> 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.


Cheers,

-- 
Caio Marcelo de Oliveira Filho
OpenBossa - INdT


More information about the webkit-qt mailing list