python - Qt Designer custom checkbox relative path -
i trying make checkbox in qt designer uses custom png images instead of checkbox.
i using custom stylesheet following content:
qcheckbox::indicator { width: 30px; height: 30px; } qcheckbox::indicator:checked { image: url(radio_selected.png); } qcheckbox::indicator:unchecked { image: url(c:\\myproject\\subdirectory\\radio_unselected.png); } qcheckbox::indicator:checked:hover { image: url(c:\\myproject\\subdirectory\\radio_selected.png); } qcheckbox::indicator:unchecked:hover { image: url(c:\\myproject\\subdirectory\\radio_unselected.png); } the absolute paths using dual backslashes deliver desired result. relative path entry doesn't work. neither does
qcheckbox::indicator:checked { image: url(./radio_selected.png); } nor
qcheckbox::indicator:checked { image: url(.\radio_selected.png); } nor
qcheckbox::indicator:checked { image: url("radio_selected.png"); } nor
qcheckbox::indicator:checked { image: url(file:///radio_selected.png); } or else i've tried... missing here?
for future reference, when using qt designer custom qss, if want image labels in relative path *.ui file, 1 has use syntax ./radio_selected.png make work.
it won't show in editor, work when calling *.ui file script.
Comments
Post a Comment