Results 1 to 5 of 5

Thread: Difference between Dialog and widget and QMainWindow

  1. #1
    Join Date
    May 2006
    Location
    Pune,India
    Posts
    63
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Difference between Dialog and widget and QMainWindow

    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).

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ifference between Dialog and widget and QMainWindow

    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.

  3. The following 3 users say thank you to jacek for this useful post:

    gfunk (30th August 2006), safknw (31st August 2006), ScumCoder (13th November 2011)

  4. #3
    Join Date
    Mar 2014
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: ifference between Dialog and widget and QMainWindow

    hi jacek,
    could you pleas explain more?
    thanks...

  5. #4
    Join Date
    Jul 2014
    Posts
    95
    Thanks
    67

    Default Re: ifference between Dialog and widget and QMainWindow

    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?

  6. #5
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ifference between Dialog and widget and QMainWindow

    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.

Similar Threads

  1. Difference between QWidget and QMainWindow
    By daviddoria in forum Newbie
    Replies: 9
    Last Post: 9th July 2018, 20:06
  2. Replies: 6
    Last Post: 14th December 2013, 15:43
  3. Replies: 2
    Last Post: 29th June 2011, 16:45
  4. Replies: 9
    Last Post: 13th August 2008, 19:07
  5. Modal dialog in QMainWindow's event() function
    By tanminh in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2007, 10:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.