[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#446371: QToolBar widget are not made visible



Hi,

After digging on the issue, i confirm the test case code doesn't have the same 
behavior between Qt4.3.1 and Qt4.3.2:
* on Qt4.3.1, the action "test" on the toolbar is visible.
* on Qt4.3.2, the action "test" on the toolbar isn't visible.

I tried on Qt4.3.2/mingw, the action "test" on the toolbar isn't visible too 
and confirm it doesn't come from our package.

installEventFilter means that all events are passed trough the QObjects event
filter before your widget gets them and all events will filtered in the 
eventFilter() member of your object.

installing an event filter on this makes totally no sense:
toolbar.cpp:14 installEventFilter(this);

it seems clear to me why it is not working.
eventFilter expects a bool return value and if you do not return a explicit
value it will use the value that is in the register.

So in most cases this will be not 0 so it will be true. And returning true 
from an eventFilter means: do not send event to the next receiver.

The test case is buggy, install the event filter in mainwindow constructor:
installEventFilter(m_toolBar), return false in ToolBar::eventFilter and remove  
installEventFilter(this).

In correct usage of the eventFilter, you can't fall on this problem.
I plan to close this bug if you agree. Feel free to open a bug upstream, if 
you really want to understand why this behavior changed between Qt4.3.1 and 
Qt4.3.2.

cheers,

Fathi




Reply to: