Results 1 to 3 of 3

Thread: QDialog 'central widget' layout

  1. #1
    Join Date
    Oct 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QDialog 'central widget' layout

    Hi to all,

    If I create a Qt project using Qt Creator and select the base class to be a QDialog a project is dutifully created and the dialog shows up in the project object box, and the icon displayed there is some type of layout type icon with a 'red slashed circle, over laying it.

    Screenshot_2.png

    My question is "How do I morph the dialog box to have a root layout of QHBox or QVBox layout? The only selection availbe for the layout is adjust size. So how to activate the deactivated layout.

    If I build a new project using 'Qt Designer Form' and use QDialog as the base class then I can select Layout->Layout horizontally for instance, and the QDialog object icon is not over layed with the red slashed circle. But there is no project file or main.cpp created.

    Screenshot_1.png

    Its straight forward enough to create a .pro file and a main.cpp and turn the whole thing into a project, but I think there must be a better way and I have not been able to find it.

    The difference between the two different dialogs is the in the first case objects(buttons, other layout, etc) do not scale as the dialog window size is adjusted. In the second case since the base dialog layout is not , uh disabled for want of a better term , all the form objects scale then the dialog window size is adjusted.

    Hopefully someone can clear up this conundrum for me.

    Thanks

    Jon

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QDialog 'central widget' layout

    My question is "How do I morph the dialog box to have a root layout of QHBox or QVBox layout? The only selection availbe for the layout is adjust size. So how to activate the deactivated layout.
    In designer, click in the dialog (focus it), and then click on the desired layout button above in the toolbox.
    Thats it.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDialog 'central widget' layout

    OK, it's funny sometimes how you can be so perplexed and yet the solution is so simple.
    Danke high_flyer,
    jon

Similar Threads

  1. Central Widget Max Height
    By fruzzo in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2011, 18:26
  2. Replies: 8
    Last Post: 28th June 2011, 14:57
  3. Problem setting central Widget layout
    By frenk_castle in forum Newbie
    Replies: 2
    Last Post: 26th September 2009, 16:43
  4. QDockWidgets without central widget
    By JoeMerchant in forum Qt Programming
    Replies: 17
    Last Post: 8th August 2007, 14:52
  5. Central Widget of QMainWindow
    By sumsin in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2006, 18:32

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.