Child widget does not move along with its parent
Dear all,
I'm doing a project using Qt MDI, which contains multiple child windows inherited from QMdiSubWindow. I added a child widget (QVTKWidget) to a child window. When I moved the child window, the child widget seemed to stay at its original position w.r.t. the mainframe. What could be the possible reason for that? Thanks a lot.
P.S.:
My OS: Mac OS 10.5.7
Qt version: 4.5.1
Re: Child widget does not move along with its parent
you mean to say your subwindow did not moved with mainwindow or you are talking about resizing?
Re: Child widget does not move along with its parent
Sorry for the confusion.
* the mainframe is fixed
* I moved the subwindow inside the mainframe
* the content of the subwindow (the child widget) did not move along with the subwindow, it was at the original position
Re: Child widget does not move along with its parent
sorry but i did not uderstood well.
1. mainframe is fixed (we will call it QMainWindow from now)
2. the subwindow is QMdiSubWindow?
3. the child widget is added as mdiSubwindow->setWidget(childwidget)?
am i right this time?
Re: Child widget does not move along with its parent
Re: Child widget does not move along with its parent
can you post a screen shot of your application in an error condition (child widget at original position and subwindow at another)
Re: Child widget does not move along with its parent
Re: Child widget does not move along with its parent
this is very strange... write a minimal compilable example reproducing the error and post the code here... have you tried the application on linux or windows?
Re: Child widget does not move along with its parent
Thanks, MrDeath.
The child widget relies on another library (VTK), unless you have this library, otherwise, you will not be able to build.
It seems that my code is fine with Linux. Moreover, it works with previous version of Qt, version 4.4 if remember correctly. It has the same problem with even earlier version, i.e., 4.3.
I guess either Qt or QVTKWidget caused this problem, but I'm not sure what could be the real cause of it.