How to prevent user select text in QWebView ? I use like this but I can't access the scrollbar
Qt Code:
To copy to clipboard, switch view to plain text mode
Thank's before
How to prevent user select text in QWebView ? I use like this but I can't access the scrollbar
Qt Code:
To copy to clipboard, switch view to plain text mode
Thank's before
You can clear the selection of the text cursor whenever the selectionChanged signal occurs.
Edit:
Thats not ok.
But you can try the QWebPage::MoveToNextChar action when the selectionChanged signal occurs. Hopefully that will move the cursor to the next character and clear the selection.
Last edited by tbscope; 9th November 2010 at 05:57.
OK. But how to clear text selected. I don't find a way in qtdoc
Make a feature request in the bugtracker, if one doesn't already exist.
Here's another try:
From: http://lxr.kde.org/source/KDE/kdepim...iew_webkit.cpp//This is an ugly hack to remove the selection, I found no other way to do it with QWebView
QMouseEvent event(QEvent::MouseButtonPress, QPoint( 10, 10 ), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier );
QCoreApplication::sendEvent( page(), &event );
QMouseEvent event2(QEvent::MouseButtonRelease, QPoint( 10, 10 ), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier );
QCoreApplication::sendEvent( page(), &event2 );
Bookmarks