Results 1 to 5 of 5

Thread: Library versions 5.14.2 & 5.15.0 widget vertically taller than 5.14.1

  1. #1
    Join Date
    Dec 2019
    Posts
    23
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Library versions 5.14.2 & 5.15.0 widget vertically taller than 5.14.1

    I just tried building 2 application C++ with 5.14.2 and 5.15.0. Both programs have all widgets taking up more vertical space than 5.14.1. This includes buttons, tabs, tables. What causes this and how do I fix it? All widgets are created with code only, I have no qml in either. I'm running on Windows 10, using mingw tool set.

    Hopefully this is enough information to answer this question.

    Thanks much

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Library versions 5.14.2 & 5.15.0 widget vertically taller than 5.14.1

    Where is the extra space? In the visible bits of widgets, or in the space between them?
    Has the default style changed between these Qt versions?
    What does
    Qt Code:
    1. qDebug() << app.style()->objectName();
    To copy to clipboard, switch view to plain text mode 
    output?
    Screen shots? Small code sample that works differently in the two versions?

  3. #3
    Join Date
    Dec 2019
    Posts
    23
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Library versions 5.14.2 & 5.15.0 widget vertically taller than 5.14.1

    Thanks for your response. Here's what I get from object name, and code I use to set style early in my program:
    Before "windowsvista"
    After ""
    qDebug()<<"Before"<<a.style()->objectName();
    QCoreApplication::setApplicationName(PGM_NAME);
    QCoreApplication::setApplicationVersion(VERSION_NU M+VERSION_DATE);
    a.setStyleSheet(QStringLiteral("QPushButton{backgr ound-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
    "stop: 0 white, stop: 1 grey);"
    "border-style: solid;"
    "border-width: 2px;"
    "border-color: black;"
    "font-weight: bold;" "padding: 0px;" "margin: 0px;"
    "min-width: 8em;" "min-height: 1.5em;"
    "max-width: 10em;" "max-height: 2em;"
    "border-radius: 7px;} "
    "QHeaderView::section {background-color: rgb(193,230,230); font: bold}"
    "QToolTip {border: 0px; background-color: rgb(255,255,100)}"
    "QComboBox::drop-downn {subcontrol-position: left}"
    "QTableWidget{background-color: rgb(193,230,230)}"));
    qDebug() <<"After"<<a.style()->objectName();
    Here is a screen shot showing the differences:
    Annotation 2020-06-01 065859.jpg

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Library versions 5.14.2 & 5.15.0 widget vertically taller than 5.14.1

    Please use [code]...[/code] tags around code and code-like content.

    Is the style reported, before you customise it, the same for the same code run with the two libraries?
    Is the difference evident if you do not apply your customisations?

    The UI is perfectly usable in both versions.
    The change is possibly the result of QTBUG-82356. The code seems to have gone into 5.15.0 and 5.14.2.

  5. #5
    Join Date
    Dec 2019
    Posts
    23
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Library versions 5.14.2 & 5.15.0 widget vertically taller than 5.14.1

    Thanks again for your reply. I tried to edit my original post to include
    Qt Code:
    1. ...
    To copy to clipboard, switch view to plain text mode 
    , but couldn't figure out how to do that.

    I got the same style reports for all versions.

    I found that if I change QPushButton padding from 0px to -1px in 5.15.0 I get button sizes I like. What I haven't been able to fix is the number of lines I can get on the screen with QTableWidget, I get 2 more with 5.14.1 (I don't do any style setting with this).

    Attached is a screen shot of all my style settings removed.
    Annotation 2020-06-06 065434-Spike.jpg

Similar Threads

  1. How to align a QComboBox vertically on Mac OS X in Qt 4
    By AndyBrice in forum Qt Programming
    Replies: 0
    Last Post: 4th March 2015, 17:45
  2. Qt Designer widget layout: dont stretch vertically
    By tuli in forum Qt Tools
    Replies: 1
    Last Post: 8th September 2012, 15:34
  3. custom widget library?
    By ihoss in forum Newbie
    Replies: 3
    Last Post: 16th September 2007, 17:39
  4. How can I write vertically in a QPushbutton ?
    By castorvert in forum Qt Programming
    Replies: 1
    Last Post: 2nd April 2006, 22:27
  5. Widget Library/Repository
    By strandtc in forum Qt Programming
    Replies: 5
    Last Post: 1st March 2006, 19:37

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.