![Quote](images/misc/quote_icon.png)
Originally Posted by
fullmetalcoder
Just to make sure the problem does not come from my code I checked another app using the same QMdiArea nesting and was able to reproduce the bug...
I somehow expected this to be a minimal compilable example or something like that. ![Smile](images/smilies/smile.png)
Does anyone have a magic trick or do I need to go on the tracker and wait for a couple of releases to have it fixed?
The "magic trick" goes here:
class InnerMdiArea : public QMdiArea
{
public:
: QMdiArea(parent) { }
{
return event
->type
() == QEvent::ApplicationActivate || event
->type
() == QEvent::ApplicationDeactivate;
}
};
class InnerMdiArea : public QMdiArea
{
public:
InnerMdiArea(QWidget* parent = 0)
: QMdiArea(parent) { }
bool eventFilter(QObject* object, QEvent* event)
{
return event->type() == QEvent::ApplicationActivate
|| event->type() == QEvent::ApplicationDeactivate;
}
};
To copy to clipboard, switch view to plain text mode
As the class name suggests, use this as the inner MDI area and everything should be fine. ![Wink](images/smilies/wink.png)
PS. The reason this works is that QMdiArea installs an event filter on QApplication and QObject::eventFilter() is virtual..
Bookmarks