Issues resizing stylesheet indicators
-
Hello,
I'm using Qt for a desktop application and am looking for some help with resizing indicators through stylesheets. I am able to set the indicator size for various widgets in stylesheets by doing the following:
QRadioButton::indicator{ height: 15px; width: 15px; }
and I'd like for the indicator sizes to be larger when running the application in fullscreen, but currently when running in fullscreen the indicator sizes will always be what I set in the stylesheet (for this example 15 px).
Is there any way of specifying a max and min indicator size or is there any way that Qt can dynamically update the indicator size similar to how it resizes widgets on layouts?
Thanks in advance.
-
Hello,
I'm using Qt for a desktop application and am looking for some help with resizing indicators through stylesheets. I am able to set the indicator size for various widgets in stylesheets by doing the following:
QRadioButton::indicator{ height: 15px; width: 15px; }
and I'd like for the indicator sizes to be larger when running the application in fullscreen, but currently when running in fullscreen the indicator sizes will always be what I set in the stylesheet (for this example 15 px).
Is there any way of specifying a max and min indicator size or is there any way that Qt can dynamically update the indicator size similar to how it resizes widgets on layouts?
Thanks in advance.
@mchabala said in Issues resizing stylesheet indicators:
Is there any way of specifying a max and min indicator size or is there any way that Qt can dynamically update the indicator size similar to how it resizes widgets on layouts?
Stylesheet and layouts are two different things...
If you set a fixed 15px, it is 15px.You could update the stylesheet when you go fullscreen mode.
-
@mchabala said in Issues resizing stylesheet indicators:
Is there any way of specifying a max and min indicator size or is there any way that Qt can dynamically update the indicator size similar to how it resizes widgets on layouts?
Stylesheet and layouts are two different things...
If you set a fixed 15px, it is 15px.You could update the stylesheet when you go fullscreen mode.
@Pl45m4 Thanks for the reply! One more question, is there any way to update the indicator other than using the stylesheet?
Currently I have an example working where the default stylesheet gets loaded and then the indicator sizes get overwritten during a
resizeEvent()
, but I was wondering if a non-stylesheet option may be better (if it exists). -
@Pl45m4 Thanks for the reply! One more question, is there any way to update the indicator other than using the stylesheet?
Currently I have an example working where the default stylesheet gets loaded and then the indicator sizes get overwritten during a
resizeEvent()
, but I was wondering if a non-stylesheet option may be better (if it exists).Hi,
You can create a proxy style and customize there the rendering of the QRadioButton.