hideEvent not propagated to tabified dock widgets
I am trying to catch the hide/show events in a widget which has been placed in a QDockWidget. The problem is that after I tabify the Dockwidget, it doesn't get those notifications anymore when I switch tabs. This behaviour differs from that of an ordinary QTabWidget.
I am using Qt 4.3.0 at the moment and I would like to know if this is wanted behaviour, or if it has been fixed in the 4.4 branch, otherwise I'll file a bug report.
Here is an example to test the behaviour:
Code:
#include <QtGui>
{
public:
MyLabel()
: timesHidden(0)
, timesShown(0)
{
}
{
timesShown++;
text.sprintf("Times hidden: %d\nTimes Shown: %d", timesHidden, timesShown);
setText(text);
}
{
timesHidden++;
}
int timesHidden;
int timesShown;
};
int main(int argc, char* argv[])
{
window.
setCentralWidget(new QTextEdit(&window
));
QList<QDockWidget*> dockWidgets;
for (int i=1;i<=3;i++){
dock->setWidget(new MyLabel);
window.addDockWidget(Qt::BottomDockWidgetArea, dock);
dockWidgets << dock;
}
window.tabifyDockWidget(dockWidgets[1], dockWidgets[2]);
window.show();
return app.exec();
}
Re: hideEvent not propagated to tabified dock widgets
So, should I consider this a bug? I would really appreciate if somebody would test it.
Re: hideEvent not propagated to tabified dock widgets
I haven't had time to look into it, but perhaps you could use QDockWidget::visibilityChanged()?