Results 1 to 2 of 2

Thread: Proper way of using Designer for MainWindows

  1. #1
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Proper way of using Designer for MainWindows

    I have created a test main window in Designer and place a bunch of UI elements in it. In struggling to get it working I find that the documentation states that you should not place a layout on the main window but place them on a widget that is defined as the central widget. I am not using a layout in this particular but in general is it best practice to create a main window with no UI on it (other than menu's, etc) and to place them all on a central widget?

    As per the documentation for dialogs, I have created my main window in Designer and then subclassed it to add functionality to it. Are there any differences in doing this for main windows vs. dialogs?

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Proper way of using Designer for MainWindows

    Quote Originally Posted by Doug Broadwell View Post
    I have created a test main window in Designer and place a bunch of UI elements in it. In struggling to get it working I find that the documentation states that you should not place a layout on the main window but place them on a widget that is defined as the central widget. I am not using a layout in this particular but in general is it best practice to create a main window with no UI on it (other than menu's, etc) and to place them all on a central widget?
    Designer handles this properly when you select the form's template as "Main Window". There will be created a central widget and the top level layout is set for the central widget. Take a look at some ui_*.h file generated by the UIC and you'll see..

    As per the documentation for dialogs, I have created my main window in Designer and then subclassed it to add functionality to it. Are there any differences in doing this for main windows vs. dialogs?
    What kind of differencies do you mean? QDialog has it's own specialities like slots accept() and reject() and QMainWindow has it's own specialities like menu/status/toolbars etc. You can use a subclassed QMainWindow and/or QDialog with a designed ui installed it like any other QMainWindow and/or QDialog.
    J-P Nurmi

Similar Threads

  1. Designer crashes when selecting some widgets
    By gwendal in forum Qt Tools
    Replies: 4
    Last Post: 21st July 2006, 14:18
  2. Adding slots in Designer
    By jamos in forum Qt Tools
    Replies: 5
    Last Post: 19th May 2006, 00:28
  3. Arthur Plugins demos and designer
    By antonio.r.tome in forum Installation and Deployment
    Replies: 4
    Last Post: 21st March 2006, 15:01
  4. Replies: 2
    Last Post: 14th February 2006, 16:28
  5. How to create custom slot in Qt Designer 4.1?
    By jamadagni in forum Qt Tools
    Replies: 31
    Last Post: 18th January 2006, 21: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.