PDA

View Full Version : How enable copy/past in application



flamaros
24th March 2010, 23:21
Hi,

I am searching a way to allow the user to made copy/past in my application with default shortcuts. Their is no way to do this for all input widgets and media document like QWebPage?

I'll be great if it works with other applications.

wysota
24th March 2010, 23:57
QWebPage is a logical entity without a physical representation. so pasting data into a QWebPage wouldn't make much sense. You could paste it into QWebView though. As far as I know all input widgets that accept textual input are equipped with appropriate copy/paste functionality. Could you describe what exactly would you want to change in their behaviour?

flamaros
25th March 2010, 11:04
I have also a QWebView.

Ok I made a test, I can do a copy with the contextual menu launched with an hit in right mouse button, but the CRTL+C shortcut doesn't work.
Shortcuts works well with input widgets (also available for forms in the web view).

wysota
25th March 2010, 15:46
Could you be more specific? Ctrl+C doesn't work where?

flamaros
25th March 2010, 18:52
Ctrl+C, doesn't work when I do it just after a selection of a text in a webpage display by a QWebView object. This text is a text of a page not coming from a html form.

wysota
25th March 2010, 20:05
Add this to your webview object:


QAction *act = webview->pageAction(QWebPage::Copy);
act->setShortcut(QKeySequence::Copy);

flamaros
27th March 2010, 22:57
Hi,

thx for your answer, but it doesn't work need I catch a signal to add the selected text in the copy buffer?

wysota
29th March 2010, 02:07
It works fine for me. If it doesn't work for you then you somehow broke the copy/paste functionality which is already present in QWebView. Retrace your steps to see what might have gone wrong.