Results 1 to 6 of 6

Thread: no MouseButtonRelease event for QComboBox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: no MouseButtonRelease event for QComboBox

    It is a bit complicated, but let me try to explain..

    It seems that the QComboBoxPrivateContainer (which is combo boxes child, not the view's child) does not get instantiated right away. Actually it doesn't get instantiated until certain QComboBox's methods (for example view()/setView(), setEditable(), shopPopu()..) are called.

    Try this:
    Qt Code:
    1. addit(box, test);
    2. box->view(); // or any other dummy call to force the private container to get instantiated
    3. foreach (QObject * cobj, box->children())
    4. addit(cobj, test);
    To copy to clipboard, switch view to plain text mode 

    Cheers!

  2. The following user says thank you to jpn for this useful post:

    Beluvius (31st March 2006)

  3. #2
    Join Date
    Mar 2006
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: no MouseButtonRelease event for QComboBox

    Ok, I have got it working now for the small example. It makes sense that the view is created later than the comboBox, but also slightly inconvenient.

    Now another problem arose when recording the events. For some reason the new selection in the combobox is not shown when recording, but it is when replaying... But that is simply an error in my code.

    Ps. Nice town you are living in, been there once. Knew some people there, but they moved.

    Thanks,
    Beluvius

Similar Threads

  1. Replies: 4
    Last Post: 19th February 2009, 12:10
  2. Custom event gets not propagated to the top level widget
    By nightghost in forum Qt Programming
    Replies: 0
    Last Post: 29th January 2009, 10:06
  3. Event propagation direction
    By spraff in forum Qt Programming
    Replies: 0
    Last Post: 6th December 2008, 22:03
  4. Qt event queue overloading?
    By gct in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2008, 19:39
  5. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 22:55

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.