Hi again,
Ok, I wrote the code in this function based on the size of my window, see in the picture what happened in attach. This is the code changed:
template<class T> T *MainWindow::createT(T *win)
{
win = new T();
QMdiSubWindow *mdiSubWin = new QMdiSubWindow;
mdiSubWin->setWidget(win);
mdiSubWin->setAttribute(Qt::WA_DeleteOnClose);
mdiArea->addSubWindow(mdiSubWin);
mdiSubWin->show();
mdiSubWin->setGeometry(0,0,450,300);
mdiSubWin->setMinimumSize(450,300);
mdiSubWin->setMaximumSize(450,300);
//mdiSubWin->setSizePolicy(qobject_cast<T *>(win)->sizePolicy());
}
template<class T> T *MainWindow::createT(T *win)
{
win = new T();
QMdiSubWindow *mdiSubWin = new QMdiSubWindow;
mdiSubWin->setWidget(win);
mdiSubWin->setAttribute(Qt::WA_DeleteOnClose);
mdiArea->addSubWindow(mdiSubWin);
mdiSubWin->show();
mdiSubWin->setGeometry(0,0,450,300);
mdiSubWin->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
mdiSubWin->setMinimumSize(450,300);
mdiSubWin->setMaximumSize(450,300);
//mdiSubWin->setSizePolicy(qobject_cast<T *>(win)->sizePolicy());
}
To copy to clipboard, switch view to plain text mode
We still can maximize the window, giving a double-click the title bar or clicking on the maximize button. Well there might be a resource for the QMdiSubWindow inherit the properties.
Bookmarks