PDA

View Full Version : The problem of the geometry() of QMenu?



koilin
10th July 2012, 11:16
I want to get the geometry of the QMenu before it being visible. I tried get the geometry at the aboutToShow() signal, but it seems to be out of control, the topLeft point of the menu's rect is always different to the QCursor::pos(). Anyone know why? Or what is the right moment to get the geometry before it show?

high_flyer
10th July 2012, 12:09
you can try installing an event filter and catch QEvent::Show.

koilin
11th July 2012, 04:31
Yes, I got the right geometry in the showEvent(). Thank you!