Hi guys,

I got a problem about Minimize button. I added my curve into a child widget through MdiSubWindow class. After I ran my project, the child window(contain the curve) showed correct.
But When I clicked the minimized button, the window minimized but restored immediately.
I tried to setWindowFlags, but it didn't work at all.

Does someone know what this problem is? And how to fix this problem?

Below is the code I add my curve into a child widget:

Axes *axes = new Axes; //Aexs is a class that inherits from QWidget and implement my curve
QMdiSubWindow* child = new QMdiSubWindow;
child->setWidget(axes);
child->resize(640, 480);
ws->addSubWindow(child); //ws is a class that inherits from QMdiArea and it is attached into a parent widget MainWindow (inherits from QMainWindow class)
child->show();

Ps: I'm porting my project from Qt4.0 to Qt.5.8. The Axes class originally inherits from QWorkspace which is deprecated in Qt 5.8. I use QMdiArea to replace the QWorkspace class.

Thanks!