[Qt-interest] How to close s subwindow?
John McClurkin
jwm at nei.nih.gov
Tue Nov 10 13:35:24 CET 2009
donglongchao wrote:
> Hi,all
>
> I have a problem when I develop a MDI app whose UI was create by QT
> Designer.The two subwindows of MdiArea were created by right-click on
> MdiArea widget and then choose "add subwindow" from the pop menu.When I
> start the app,both of the two subwindows appears,but I just want one of
> them to appears.So I find two function called void *closeActiveSubWindow
> <http://doc.trolltech.com/4.5/qmdiarea.html#closeActiveSubWindow>* ()
> and void *closeAllSubWindows
> <http://doc.trolltech.com/4.5/qmdiarea.html#closeAllSubWindows>* ().But
> neither of them is what I need.I just want a function who can close some
> certain subwindow I want to close. Is there any function like that ,but
> I missed somewhere?
If closeActiveSubWindow() or closeAllSubWindows() won't work for you,
you will have to write your own function that iterates over all the
subwindow to find the one you want to close.
Or I could reach my goal(start the app with only one
> subwindow appears) through other better way?Any suggestions are welcomed.
You can write your app so that only one subwindow appears on startup.
You can also write your app so that no subwindows appear on startup.
Whether a subwindow is shown depends on whether you call show() on the
object.
> Thanks a lot in advance.
>
> Longchao
>
>
>
> ------------------------------------------------------------------------
> "Ñ©¼û"ÑîÃÝÑûÄ㹲Ʒ3D¹úÔÏÍøÓΡ¶ÌìÏ·¡¡·£¬º£±¨Ãâ·ÑÁì
> <http://allyes.nie.163.com/main/adfclick?db=afanie&bid=1258,613,23&cid=147,4,1&sid=1355&show=ignore&url=http://tx2.163.com/fab.html>
>
More information about the Qt-interest-old
mailing list