PDA

View Full Version : Difference between Dialog and widget and QMainWindow



safknw
30th August 2006, 12:13
what is difference between Dialog and widget and QMainWindow. I didn't understand the difference between these 3 classes.
Pls some body can explain me.
I'm building an application which does not have menu but have some child widgets(forms).

jacek
30th August 2006, 12:33
A widget is an object that can be displayed on the screen. For example a window or a button.

A dialog is a top-level widget, that is always displayed in separate window (i.e. you can't put it on another widget).

A main window is also a top-level widget, but it has a predefined layout that includes a menu bar, a status bar and place for tool bars and dock areas.

jsaye
8th April 2014, 12:34
hi jacek,
could you pleas explain more?
thanks...

rezas1000
15th August 2014, 19:06
A dialog is a top-level widget, that is always displayed in separate window (i.e. you can't put it on another widget).

Do you like when we click a button (New) and a new window opens?

Brandybuck
25th August 2014, 19:05
Widget: A rectangular region on the screen for display and user interaction. They include buttons, sliders, views, dialogs, windows, etc. All widgets will display something on the screen, and many will also accept user input from the keyboard or mouse. The word "widget" comes from Unix, on Windows they are called "controls".

Window: A "top level" widget. A window is the top of a parent/child hiearchy, and are usually displayed with a titlebar and border. The underlying windowing system (Windows, KDE, GNOME, etc) will provide policies for the windows, such as titlebar/border style, placement, focus, etc.

Dialog: A special kind of window, usually temporary. They may or may not have a different titlebar appearance. They are presented to the user for the purpose of notification or gathering input, and typically have OK, Cancel, etc., buttons on the bottom or right.

The key here is that all of these are widgets, windows are the top-level widgets, and dialogs are a special kind of window.