Results 1 to 2 of 2

Thread: QDockWidget and Qt Creator designer

  1. #1
    Join Date
    Sep 2016
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default QDockWidget and Qt Creator designer

    I'm starting to learn some Qt and my background is mostly embedded software and C# for quick tools with UI. I cant make much sense of the geometry/size policies/minimum size/maximum size so I started fiddling around, nothing better than some field testing no?

    Now I create a brand new project, open the Qt Creator designer, add a QDockWidget on the left side of the QMainWindow, then I hover on the QDockWidget right side and increase the size of the dock widget to 150pixels, add 3 buttons and manually position them in the dock window in the very middle. Now my thinking here is very WYSWYG. So i decide, lets run and see what happens.

    To my very disappointment "what i see is not what i get"... The size of the QDockWidget when I run the app is the same as when I dropped it, before hovering ad making it wider...and the push-buttons are cut right in the middle.

    I might be a newb, I might be picky but right now I don't really understand why the designer is showing me something and at run-time the app is doing something else.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QDockWidget and Qt Creator designer

    Normally you will get what you see, however, it could be that the QDockWidget, since it is a special kind of container, has some runtime resizing code and attempts to resize to its content.

    If your content is not properly layouted, then it will not "see" the content's requirements and fall back to some default size.
    You could override that by e.g. setting a minimum width, but ideally you'll fix the layout.

    Cheers,
    _

Similar Threads

  1. QT Designer and QT Creator
    By rakeshthp in forum Newbie
    Replies: 1
    Last Post: 8th November 2015, 06:58
  2. Using Qt Designer on Qt Creator
    By Ramzeez in forum Newbie
    Replies: 1
    Last Post: 24th April 2012, 22:54
  3. Replies: 3
    Last Post: 10th December 2009, 22:53
  4. Replies: 0
    Last Post: 13th July 2009, 20:20
  5. Replies: 5
    Last Post: 10th May 2006, 00:20

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
  •  
Qt is a trademark of The Qt Company.