PDA

View Full Version : Checkbox and Radiobutton are not alligned with stylesheet



Nyte
5th June 2014, 10:44
Hi all, i need some help solving this weird thing happening in my Designer.

I made some images to replace the Radiobutton and Checkbox and applied them to QRadioButton and QCheckBox via stylesheet.
The images are exactly the same size and the checkbox and radiobutton are in the same location in the image, but in designer, the radiobutton is slightly to the right.

See this image:
10394

I use the following stylesheet:

QRadioButton::indicator { image: url(:/images/radiobutton_default.png) }
QCheckBox::indicator { image: url(:images/checkbox_default.png); }

If i remove the stylesheet and look at the default radiobutton/checkbox, i can see they are aligned.
10395

Anyone knows why this happens? If the images are the same size and are applied the same way, shouldn't they align as well?

-edit-
Well, here's a self fix i guess:
I removed the images from the resource file and re-added them. Rebuild the project and now it's working fine. Don't know what changed, but it works now i guess.

MichaU1337
4th July 2014, 00:02
I noticed that sometimes when you add/change icons or you add a pixmap they dont look nice and are not aligned, but after running the app it works well. A rebuild helped me as well.