I am trying to use a style sheet to change a QStyleOptionButton to work as a QCheckBox but display with my own checked/unchecked indicators. I have had success setting the stylesheet on normal checkboxes but in this case I need to use a QStyleOptionButton and this doesnt seem to work? My code is as follows:

Qt Code:
  1. //m_checkBoxRect is previously setup
  2. m_checkboxRect.setY(rect.height() / 2 - m_checkboxRect.height() / 2);
  4. QCheckBox* styledCheckBox = new QCheckBox();
  5. styledCheckBox->setGeometry(m_checkboxRect);
  6. styledCheckBox->setCheckState(m_checkboxState);
  7. styledCheckBox->setStyleSheet(
  8. "QCheckedBox::indicator:unchecked { image: url(:/Resources/indicator_off.png);}"
  9. "QCheckedBox::indicator:checked { image: url(:/Resources/indicator_on.png);}"
  10. "QCheckedBox::indicator:indeterminate { image: url(:/Resources/indicator_partial.png);}"
  11. );
  13. option.initFrom(styledCheckBox);
  14. option.rect = m_checkboxRect;
  16. style()->drawControl(QStyle::CE_CheckBox, &option, painter, this);
To copy to clipboard, switch view to plain text mode 

All I seem to get back is an unchecked checkbox which doesn't respond to my mouse presses.

Does anyone have any ideas as to why this wont work, or perhaps another route??