Qmdiarea and qsubwindow in QT

Source: Internet
Author: User

Yesterday, I calmed down and looked at qmdiarea carefully.

As the central component of mainwindow, qmdiarea is still very effective.

First, add qsubwindow to qmdiarea and delete qsubwindow from qmdiarea.

Qsubwindow * addsubwindow (qwidget * widget );

The widget can be a qsubwindow or a qwidget and a subclass directly. If the widget is the latter, qmdiarea automatically creates a qsubwindow and sets the widget as the setwidget () of qsubwindow ();

 

 

First, removesubwindow does not delete the widget, and then click the close button of subwindow. MDI does not call removesubwindow, but only hides the widget. To re-display the subwindow, only subwindow-> shownormal () is used (), form-> show ();

To hide the function, you can call the hide () function of subwindow.

 

Orthodox shutdown and display are paired calls of addsubwindow and removesubwindow.

 

You can set the wa_deleteonclose attribute of the subwindow and its widgets. When it is closed, the subwindow and its widgets will be deleted, and the created form and subwindow will be copied and displayed. This is necessary in some cases, at least memory savings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.