• 12376阅读
  • 1回复

mainwindow,widget,dialog有什么区别 [复制链接]

上一主题 下一主题
离线btbrownie
 
只看楼主 正序阅读 楼主  发表于: 2009-08-17
创建Gui Application时,有qmainwindow,qwidget和qdialog三种类型。请问有什么区别?谢谢
离线dbzhang800

只看该作者 1楼 发表于: 2009-08-17
QMainWindow 和 QDialog 是最常用的顶级窗口,是QWidget的子类
具体请看Qt的手册

The QDialog class is the base class of dialog windows.

A dialog window is a top-level window mostly used for short-term tasks and brief communications with the user. QDialogs may be modal or modeless. QDialogs can provide a return value, and they can have default buttons. QDialogs can also have a QSizeGrip in their lower-right corner, using setSizeGripEnabled().

Qt Main Window Framework

A main window provides a framework for building an application's user interface. Qt has QMainWindow and its related classes for main window management. QMainWindow has its own layout to which you can add QToolBars, QDockWidgets, a QMenuBar, and a QStatusBar. The layout has a center area that can be occupied by any kind of widget. You can see an image of the layout below.
快速回复
限100 字节
 
上一个 下一个