mercredi 30 septembre 2015

Qt Designer custom checkbox relative path

I am trying to make a Checkbox in Qt Designer that uses custom png images instead of the checkbox.

I do this by using a custom stylesheet with 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 the desired result. The 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 anything else that i've tried... what am I missing here?




Aucun commentaire:

Enregistrer un commentaire