Results 1 to 3 of 3

Thread: Shape-changing dialog group box not properly sized

  1. #1
    Join Date
    Apr 2018
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Shape-changing dialog group box not properly sized

    Hi all,

    I am new in Qt programming and I use Linux/KDE4/Qt 4.8.7 + Qt creator 2.8.0 + Qt Designer.
    Since I am new to QT I am trying to learn it from the C++-GUI-Programming-with-Qt-4-1st-ed.pdf - GUI-Programming-with-Qt-4-1st-ed.pdf

    There is an example code for a simple ui based Dynamic dialog. The Ui is created in Designer and coded in Qt Creator (with qmake compile for ui). All works ok except that the window is not properly formatted. This is how it looks like:
    sortdialog.jpeg

    The code is simple - sortdialog.ui, sortdialog.h, sortdialog.cpp, main.cpp
    sortdialog.ui
    sortdialog.h
    sortdialog.cpp
    main.cpp

    I am not sure why the dialog size is deformed. When I hit "More" button it looks ok.

    Can anybody help please?

    Thanks
    Last edited by qzoltan; 5th April 2018 at 12:02.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Shape-changing dialog group box not properly sized

    The UI file hard-codes the initial geometry to a size 256 x 306 pixels. What is probably happening is that your system has a larger font size or scale than that used by the book's author, so the widgets that contain text get clipped. When you click the "More" button and the widget expands dynamically, the dialog then automatically adjusts its size so everything fits. I think if you manually adjust the size of the dialog by grabbing the size handle (before clicking "More") you can get it to look normal.

    Open the UI file in Qt Designer and resize the dialog until everything fits, then save and rebuild. Then the dialog should look as you expect.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Apr 2018
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Shape-changing dialog group box not properly sized

    Thanks for the help. This solved the issue. Another issue I had is that the resulting ui_sortdialog.h is not updated when I perform clean all/rebuild from the Qt Crator API. I need to perform qmake/make all the time from the command line.
    Anyway the size issue was fixed by Qt Designer resize / rebuild. Thanks again.

Similar Threads

  1. Replies: 4
    Last Post: 4th September 2017, 09:30
  2. Replies: 0
    Last Post: 22nd March 2017, 18:00
  3. Replies: 4
    Last Post: 25th May 2016, 11:27
  4. Replies: 1
    Last Post: 14th June 2011, 15:50
  5. How to close (exit) a dialog properly
    By cooper in forum Newbie
    Replies: 6
    Last Post: 9th March 2011, 19:19

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.