0

I have created a QCheckbox in QT Creator called 'override'.

I want to change the size of the actual checkbox, not the font of the text associated with it.

Is there a way of doing this?

  • Maybe but that seems overly complicated and involves loading in a new image. Surely the point of QT Creator is to make this things more dynamic... – Dr James Sprinks Feb 26 '18 at 12:51
  • An alternative, but not less complicated solution might be to derive a class from `QProxyStyle` and override the pixelMetric(). – SteakOverflow Feb 26 '18 at 13:22
  • Also note that the image stuff is optional, I think. It works without it for me, at least. (Might be platform specific though.) – SteakOverflow Feb 26 '18 at 13:27

1 Answers1

1

Thanks for the help - I used this:

eyeChk = new QCheckBox("Eyes:");
_eyeChk->setStyleSheet("QCheckBox::indicator { width:150px; height: 150px;} QCheckBox::indicator::checked {image: url(/home/jvdglind/Downloads/280px-PNG_transparency_demonstration_2.png);}");

And just found sound decent default checkbox images.