공부/Python

220330 Qt Designer Templates 비교

강경국 2022. 3. 30. 10:31
반응형

 

 

Qt Designer로 시작시 Templates 의 차이가 궁금.

Dialog, MainWindow, Widget의 차이가 뭐지?

 

1. Widget : 우측의 객체 탐색기를 보면. QWidget 클래스다.

 

2. MainWindow : QMainWindow 클래스를 사용하고 menubar와 statusbar가 포함되어 있다.

 

 

3. Dialog without Buttons : QDialog 클래스를 사용한다.

 

 

구글링 하니 아래 내용이 있으니 참고.

 

When working with widgets the practical choice is between QMainWindow, QWidget and QDialog.

The QDialog choice is obvious for, well, dialogs. It includes and exec() method to start a local loop and has methods to standard dialog actions - accept and reject (ok/cancel).

QMainWindow has features for building a main app experience. It has built-in specialized layout for housing status and tool bars. It also has a powerful docking capabilities for creating dynamic app layouts using QDockWidgets.

QWidget is the generic choice when you don't need any of the above capabilities. This is often true for various tool windows, widgets meant to be embedded in the QDockWidgets and all the windows types that don't have rich widget-based UI eg. games or visualization windows.

Depending on an app type there's usually a single QMainWidget used for the main app window, several smaller QWidget based windows as docks, visualization and tool windows and occasional QDialogs for "talking" to the user.

출처: <https://forum.qt.io/topic/47930/main-window-class-vs-widget-class/4>

 

 

참고) Qt Designer 5.14.2 Version

728x90
반응형