Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.10.1
-
None
-
Windows 10, XCB, Open Source
Description
The text-decoration:underline on QPushButton seems to be obfuscated by any background color. It works fine if the background is transparent.
For example, this works:
#printBtn:hover { background-color: transparent; text-decoration: underline; }
This does not work:
#printBtn:hover { text-decoration: underline; }
I originally brought this up on Stack Exchange here.
Another user S.Monteleone offered this fix/advice to me.:
It is indeed a Qt bug, I was able to obtain the same result with Qt 5.10.1.
QPushButton does support font changes. That was not the case before, but it has been "fixed" (see "QPushButton: draw label using the stylesheet's font." b3c5d3dde9d554dcae0888e3fb4e583919cd102a this commit).
I guess the issue is at line 3484 of file qtbase/src/widgets/styles/qstylesheetstyle.cpp:
if (rule.hasPosition() && rule.position()->textAlignment != 0) {
because the else part of this if clause (line 3556) will call:
ParentStyle::drawControl(ce, &butOpt, p, w);In fact, you can force it to work also by setting the text-align:
#printBtn:hover { text-align: center; text-decoration: underline; }I'm afraid there's not much we can do except filing a bug report at http://bugreports.qt.io.
Attachments
Issue Links
- relates to
-
QTBUG-8990 QPushButton checked state stylesheet does not apply font styles
- Closed