I managed to find a solution to this.

By simply drawing the pixmap rather than the control element I am able to produce th desired results. The mouse press event for the parent widget can allow me to detect mouse clicks over the m_checkboxRect area and therefore maintain the checked state.

Qt Code:
  1. switch (m_checkboxState)
  2. {
  3. case Qt::Checked:
  4. option.state = QStyle::State_On;
  5. indicatorPixmap = QPixmap(":/Resources/indicator_on.png");
  6. break;
  7. case Qt::Unchecked:
  8. option.state = QStyle::State_Off;
  9. indicatorPixmap = QPixmap(":/Resources/indicator_off.png");
  10. break;
  11. case Qt::PartiallyChecked:
  12. option.state = QStyle::State_NoChange;
  13. indicatorPixmap = QPixmap(":/Resources/indicator_partial.png");
  14. break;
  15. default:
  16. break;
  17. }
  18.  
  19. style()->drawItemPixmap(painter, m_checkboxRect, 0, indicatorPixmap );
To copy to clipboard, switch view to plain text mode