I have found a "solution" to the problem. I took inspiration from the following page on the Qt faq / knowledge base: http://developer.qt.nokia.com/faq/an..._a_qmainwindow
As described in my previous post, I set the size policy of my child widget to be "Minimum" in the constructor. I then set up an event filter in the class and changed the size policy back to "Expanding" when an QEvent::Enter event occurs:
{
if(event
->type
() == QEvent::Enter)
return QWidget::eventFilter(obj, event
);
}
bool MdiChild::eventFilter(QObject* obj, QEvent* event)
{
if(event->type() == QEvent::Enter)
{ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); }
return QWidget::eventFilter(obj, event);
}
To copy to clipboard, switch view to plain text mode
A bit hackish in my opinion but it does the job. Not sure it if would work with a central widget in an SDI main window due to the 2/3's restriction. I may give it a try.
Bookmarks