diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-10-10 14:33:53 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-11-14 20:28:35 +0100 |
commit | 01ec11507d7ef3de09bad9d1ef8e6d4a3d6c4428 (patch) | |
tree | 10371581dfcbc8e47955a07fa14376e3c4a351ad /.tag | |
parent | a4751f8824723acaee4b9d8aa78a59c2aa36cb3e (diff) |
QStyleSheetStyle: add new property to QPushButton: icon
There is currently no proper way to change the icon of a
pushbutton from css. But there is a need for doing so
(QTBUG-2982), and the typical work-around is to instead use
the css property 'qproperty-icon'. But setting qproperties
from the style is not a good idea in the first place, since
it modifies the state of the widget it draws. Moreover, such
properties are only set once (in QStyle::polish()), and
will not have any effect on pseudo states, like hover.
To close this gap, this patch will add a css property
'icon' that can be set on a QPushButton. This property
will follow normal css cascading, and respect pseudo
states, equal to any other css property.
[ChangeLog][QtWidgets][QStyle] You can now set the
CSS property 'icon' on a QPushButton to override
which icon to draw.
Fixes: QTBUG-79137
Change-Id: Ie7e0b0fa4f19471f51108cd4ca931356219d562e
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to '.tag')
0 files changed, 0 insertions, 0 deletions