I subclass QToolBar and create some QToolButtons and create and set menu for every QToolButton, all things work good until I connect 'QMenu::aboutToShow()' to a 'SLOT'!! And then I see that menus are showed in an incorrect position!!!
when I looked at 'qtoolbutton.cpp' I see this code:
I can't understand using 'QObject::receivers(const char *signal)' in such a bad way!!!!! Why we should get different results just because of creating a connection!!!!?Qt Code:
void QToolButtonPrivate::popupTimerDone() { ... QPoint p; QSize sh = ((QToolButton*)(QMenu*)actualMenu)->receivers(SIGNAL(aboutToShow()))? QSize() : actualMenu->sizeHint(); ... //computing 'p'! 'sh' is used in this computation ... actualMenu->exec(p); ... }To copy to clipboard, switch view to plain text mode
It's unbelievable...
For solving the problem I use 'QEvent::Show' in replace of 'QMenu::aboutToShow()'!
Bookmarks