Results 1 to 3 of 3

Thread: Copy / Paste doesn't work with LineEdit

  1. #1
    Join Date
    Jan 2007
    Location
    Dhaka, Bangladesh
    Posts
    9
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation Copy / Paste doesn't work with LineEdit

    I have a PushButton and LineEdit in a form created with Qt Designer. I wanted to copy the text of LineEdit into clipboard by clicking the PushButton, so I connected the PushButton's clicked() signal to LineEdit's copy() slot (in Signal/Slot edit mode). But it doesn't work (same with cut() slot). However, other slots like paste(), hide() etc seem to work.

    Can anyone tell me what's the problem?

    BTW, even if the LineEdit is read-only, I can still paste text in it by clicking the PushButton!! (when I have click() signal connected to paste() slot)
    Last edited by ia32; 5th May 2008 at 21:42.

  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: Copy / Paste doesn't work with LineEdit

    Is any text selected when you call copy()? If not, call selectAll() before doing that.

  3. The following user says thank you to wysota for this useful post:

    ia32 (5th May 2008)

  4. #3
    Join Date
    Jan 2007
    Location
    Dhaka, Bangladesh
    Posts
    9
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Copy / Paste doesn't work with LineEdit

    No, I didn't do that. It works now, after connecting both selectAll() and copy() to clicked() signal.

    Thx.

Similar Threads

  1. QGraphicsView Copy and Paste
    By stevel in forum Qt Programming
    Replies: 14
    Last Post: 13th January 2014, 07:57
  2. using cut(), copy(), paste()
    By systemz89 in forum Newbie
    Replies: 5
    Last Post: 18th December 2007, 14:47

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.