Results 1 to 2 of 2

Thread: Hi All, Problem in managing events

  1. #1
    Join Date
    Oct 2009
    Location
    Bangalore
    Posts
    3
    Thanks
    1
    Qt products
    Qt4

    Default Hi All, Problem in managing events

    Hello all, I created one widget, say it as parent. I placed many push buttons and Icons on that parent widget. So, all Push buttons and Icons were now children for Parent widget.
    Now Problem is : When I click on any push button, that push button receives the mouse event. But I dont want that. I want my Parent Widget to receive the mouse events prior to child widgets. What I have to do??
    Please send me the solution.
    Thanks in advance
    If you did not understand I will send again a clear message.
    thank you,

    siva

  2. #2
    Join Date
    Oct 2009
    Posts
    19
    Thanked 1 Time in 1 Post

    Default Re: Hi All, Problem in managing events

    Hello siva, I guess I understand what you want to do, I don't know if I'll be clear enough to explain how I think you could do it.
    First of all if you have your own QPushButton class (you did a subclass) you could just reimplement the mousePressEvent() function and do something like a delegate with the event to the parent; may be using
    nativeParentWidget() you can obtain the button's parent and then pass it the event you have just recieved.
    Another way I can figure out is connecting the clicked() SIGNAL of the button, with some SLOT in your widget (perent) that do the job (in this case the event wouldnt be managed by your parent, you just would be usig signals and slots as its expected).
    Well thaths what I got....hope it helps

    Good luck!

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

    siva prasanna (6th November 2009)

Similar Threads

  1. Replies: 19
    Last Post: 3rd April 2009, 23:17
  2. Problem with events changing behavior of QListWidget
    By riklaunim in forum Qt Programming
    Replies: 10
    Last Post: 22nd December 2008, 19:10
  3. deployment problem: msvc++ 2008 Express, Qt 4.4.3
    By vonCZ in forum Qt Programming
    Replies: 7
    Last Post: 10th November 2008, 14:38
  4. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.