Qdialog Qmainwindow Qwidget qframe different times.

Source: Internet
Author: User

inheritance relationship: In QT All classes have a common base class Qobject, Qwidget directly inherit with Qpaintdevice class, Qdialog, Qmainwindow, Qframe directly inherit Qwidget class.   the Qwidget class is the base class for all user-interface objects. A window part (Qwidget) is a basic unit of the user interface: it receives mouse, keyboard, and other events from the window system and draws itself on the screen. Each widget is rectangular, and they are arranged clockwise by the z-axis. A widget can cover a part of his parent widget or the widgets in front of it.  the Qmainwindow class provides a menu bar, an anchor window (such as a toolbar), and a main application window for a status bar. The main window is typically used to provide a large central window widget along with the surrounding menus, toolbars, and a status bar. Qmainwindow is often inherited because it makes it easy to encapsulate central parts, menus and tools, and window status bars, which are called when the user taps a menu item or toolbar button. Based on the main window of the application, the default already has its own layout manager.  the Qdialog class is the base class for dialog Windows. A dialog window is a top-level window that is primarily used for short-term tasks and for user brief communication. Qdialog can be modal dialogs or non-modal dialog boxes. Qdialog supports extensibility and can provide return values. They can have default buttons. Qdialog can also have a qsizegrip at the bottom right of it, using setsizegripenable (). Note: Qdialog uses the parent widget in a way that differs from other classes in Qt. The dialog box is always the top-level widget, but if it has a parent object, its default location is the middle of the parent object. He will also share the toolbar entry with the parent object. Qdialog is the most common top-level window (a widget that is not embedded in the parent widget is called a top-level widget). Typically, a top-level widget is a window with a frame and a title bar (although a certain window part tag is used, the top-level widget can also be created without this adornment) in Qt. Qmainwindow and sub-classes of different qdialog are the most common top-level windows. A non-top-level window part is a child window part. They are child windows in their parent widget. You usually cannot discern a child widget from their parent widget at a visual angle. The vast majority of other widgets in QT are useful only as sub-widgets. (It's also possible to use a button as a top-level widget, but most people prefer to put their buttons in other parts)If this is a top-level dialog, it is created based on Qdialog, if it is the main form, based on Qmainwindow, if it is not, or if it is possible to be a top-level form, or possibly embedded in another form, is created based on Qwidget.  The Qframe class is the base class for widgets that have frames. It draws the part and calls a virtual function drawcontents () function to populate the frame. This function is re-implemented by the quilt class. The Qframe class can also create simple frames with no content between them, although it is common to use Qhbox or qvbox, as they can automatically lay out the widgets you put into the frame.

Qdialog Qmainwindow Qwidget qframe different times.

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.