PDA

View Full Version : Library versions 5.14.2 & 5.15.0 widget vertically taller than 5.14.1



spike6479
29th May 2020, 21:01
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

ChrisW67
1st June 2020, 07:40
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
qDebug() << app.style()->objectName();output?
Screen shots? Small code sample that works differently in the two versions?

spike6479
1st June 2020, 12:08
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{background-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-down:on {subcontrol-position: left}"
"QTableWidget{background-color: rgb(193,230,230)}"));
qDebug() <<"After"<<a.style()->objectName();
Here is a screen shot showing the differences:
13461

ChrisW67
6th June 2020, 04:52
Please use
... 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 (https://bugreports.qt.io/browse/QTBUG-82356). The code (https://github.com/qt/qtbase/commit/835e18d9ff79867f508fc8baac7fcc5bb4efc0cb?diff=unif ied) seems to have gone into 5.15.0 and 5.14.2.

spike6479
6th June 2020, 12:02
Thanks again for your reply. I tried to edit my original post to include
..., 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.
13464