Results 1 to 8 of 8

Thread: How enable copy/past in application

  1. #1
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

    Default How enable copy/past in application

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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How enable copy/past in application

    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?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How enable copy/past in application

    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).
    Koalabs Studio

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How enable copy/past in application

    Could you be more specific? Ctrl+C doesn't work where?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How enable copy/past in application

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

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How enable copy/past in application

    Add this to your webview object:

    Qt Code:
    1. QAction *act = webview->pageAction(QWebPage::Copy);
    2. act->setShortcut(QKeySequence::Copy);
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How enable copy/past in application

    Hi,

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

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How enable copy/past in application

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to Enable Touchscreen
    By Rajeshsan in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th September 2009, 07:51
  2. cant enable dbus
    By khcbabu in forum Installation and Deployment
    Replies: 1
    Last Post: 19th February 2009, 20:05
  3. enable all Tooltips
    By clive in forum Qt Programming
    Replies: 3
    Last Post: 2nd January 2008, 11:08
  4. enable layout
    By mickey in forum Newbie
    Replies: 6
    Last Post: 12th July 2006, 23:00
  5. How to enable QWS_IM in qte-3.3.5 ?
    By kevin lin in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 29th June 2006, 06:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.