What's the difference between QMainWindow, QWi

2019-03-07 15:06发布

What's the difference between QMainWindow, QWidget and QDialog?

1条回答
狗以群分
2楼-- · 2019-03-07 15:48

A QWidget is the base class for all drawable classes in Qt. Any QWidget-based class can be shown as a window by showing it when it has no parent.

A QDialog is based on QWidget, but designed to be shown as a window. It will always appear in a window, and has functions to make it work well with common buttons on dialogs (accept, reject, etc.).

QMainWindow is designed around common needs for a main window to have. It has predefined places for a menu bar, a status bar, a toolbar, and other widgets. It does not have any built-in allowances for buttons like QDialog does.

查看更多
登录 后发表回答