Results 1 to 5 of 5

Thread: PyQt4. QTextEdit. How I can overload copy()?

  1. #1
    Join Date
    May 2009
    Posts
    3
    Thanks
    1
    Qt products
    Platforms
    Unix/X11 Windows

    Default PyQt4. QTextEdit. How I can overload copy()?

    Hi all.

    Can anybody help with next problem. I trying to overload "copy()" method of QTextEdit, but it doesn't work.
    Qt Code:
    1. class MyQTextEdit(QtGui.QTextEdit):
    2. def __init__(self, *args):
    3. QtGui.QTextEdit.__init__(self, *args)
    4.  
    5. def copy(self):
    6. QtGui.QTextEdit.copy(self)
    7. print "copy"
    To copy to clipboard, switch view to plain text mode 

    But after execution when I copy text from my QTextEdit console still empty. Why?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: PyQt4. QTextEdit. How I can overload copy()?

    because this slot is not virtual.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    May 2009
    Posts
    3
    Thanks
    1
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: PyQt4. QTextEdit. How I can overload copy()?

    Hmm... if I want do any additional actions when users copy text from qtextedit, how I can release this?
    P.S. Sorry for my english %).

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: PyQt4. QTextEdit. How I can overload copy()?

    I don't know what do you want to achive, but take a look at this signal QTextEdit::copyAvailable.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. The following user says thank you to spirit for this useful post:

    lizzard (6th May 2009)

  6. #5
    Join Date
    May 2009
    Posts
    3
    Thanks
    1
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: PyQt4. QTextEdit. How I can overload copy()?

    This is not exactly solution... but thanks, will think about it.
    P.S. Sorry for my english %).

Similar Threads

  1. Replies: 1
    Last Post: 27th November 2014, 09:11
  2. QTextEdit - copy and paste problems in X11
    By chezifresh in forum Qt Programming
    Replies: 2
    Last Post: 30th June 2008, 19:21

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
  •  
Qt is a trademark of The Qt Company.