Results 1 to 2 of 2

Thread: Is it possible to QCoreApplication.sendEvent a hand made QDropEvent ?

  1. #1
    Join Date
    Feb 2010
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Is it possible to QCoreApplication.sendEvent a hand made QDropEvent ?

    Is it possible to manually create a custom QDropEvent, and then send it to a widget ?

    Qt Code:
    1. in a dialog.button.clicked slot:
    2. md = QtCore.QMimeData()
    3. md.setText('ZZz')
    4. e = QtGui.QDropEvent( QtCore.QPoint( 1, 1 ) , QtCore.Qt.CopyAction ,
    5. md, QtCore.Qt.NoButton, QtCore.Qt.NoModifier ,QtCore.QEvent.Drop )
    6.  
    7. print QtGui.QApplication.instance().sendEvent( self , e ) # prints False
    To copy to clipboard, switch view to plain text mode 

    The above is not working. It does work for myEvent subclass of QEvent, but not for a QDropEvent. I am curious why.

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

    Default Re: Is it possible to QCoreApplication.sendEvent a hand made QDropEvent ?

    Did you send drag enter event and drag move event prior to sending the drop event?
    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. I receive QDragEnterEvent, but not QDropEvent
    By Ishmael in forum Qt Programming
    Replies: 5
    Last Post: 27th October 2009, 01:25
  2. QDropEvent
    By addu in forum Qt Programming
    Replies: 26
    Last Post: 6th July 2009, 09:25
  3. How to sendEvent QPaintEvent ?
    By SABROG in forum Qt Programming
    Replies: 23
    Last Post: 28th May 2009, 21:55
  4. May I get XEvent from QDropEvent?
    By alfa_wu in forum Qt Programming
    Replies: 4
    Last Post: 19th March 2007, 01:43
  5. Replies: 4
    Last Post: 26th July 2006, 07:06

Tags for this Thread

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.