Results 1 to 2 of 2

Thread: QWidget post event

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default QWidget post event

    I have QWidget containing several child widget.

    I only have track of the parent widget and not its childs.
    I'd like to emulate a mouse click to a specific position.
    So that one of the child widget gets the mouseClick event depending on cursor's position.

    Is it possible to emulate that behaviour using postEvent or sendEvent ?

    Thanks.

  2. #2
    Join Date
    Aug 2008
    Posts
    60
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QWidget post event

    Hi,
    > I only have track of the parent widget and not its childs.
    QWidget has children() method via which you can get list of child widgets...

    > I'd like to emulate a mouse click to a specific position.
    >So that one of the child widget gets the mouseClick event
    >depending on cursor's position.
    If QWidget is the parent and QPushbutton is the child then when you click on QPushbutton then you will get the QPushbutton::mouseClick/Press event...

Similar Threads

  1. Replies: 0
    Last Post: 11th November 2008, 16:36
  2. Qt event queue overloading?
    By gct in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2008, 19:39
  3. Replies: 1
    Last Post: 31st October 2007, 15:14
  4. How to disable maximum event in QWidget??
    By hesummar in forum Qt Programming
    Replies: 2
    Last Post: 28th October 2006, 14:21
  5. How to post a key event to another application
    By mitskits in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2006, 14:09

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.