Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Paste some text that copied to clip board(android os) inside a textfield



  • How to paste a string inside text field that copied in clipboard(android os)..
    This is my need that i want to copy a piece of text from email that I copied easily from browser or some other applications, now i need to paste in inside the application's user-name or some other fields. I tried TextField::copy () methods that is not working for me. Is there any other components other than text field that supports copy, cut and paste actions.


  • Lifetime Qt Champion

    Hi,

    Is QClipboard what you are looking for ?



  • Thanks for replying, the actual i need is i want to copy a piece to text from browser or some other app, that i got by default long press and copied that piece of text to clipboard. The above i mentioned done automatically.
    But here is i'm looking for in my application i need to paste the piece of text.

    1. once i long pressed the text field that i'm having,
    2. It needs to show paste option.
    3. There by when i just press that paste option that copied content will automatically pasted in to required field.


  • So, for pasting you used TextField::copy()...

    Wouldn't you think that it is for copying something to clipboard and TextField::paste() just might be the function to use for pasting it?


Log in to reply