Quote Originally Posted by montylee View Post
Ok ,so it seems that it is possible to draw a custom checkbox which is visible at all times using a custom delegate.
Honestly I don't see a point of doing that if the default delegate already does it.

But i am still confused as to how to implement a custom painted checkbox which will be visible at all times.
The code is in my previous post. It's taken directly from Qt sources.

My current code has the normal checkbox working using Qt::CheckStateRole as you suggested earlier. Now, if i want to add custom drawing to it, what should i do?
It's not a "normal" checkbox. It uses the code from my previous post.

Suppose, i write a custom delegate to display a checkbox at all times. So, i'll rewrite the paint function of the delegate to display a virtual checkbox at all times. In addition, to support editing of the checkbox (check/uncheck) by the user, i need to rewrite the createEditor(), setEditorData() and setModelData() functions in the custom delegate.
Could you first say what is the effect you want to achieve that is not available by default?

So, when the application runs, user will see a virtual checkbox because of the paint() function of the custom delegate and if the user clicks the checkbox, the delegate should go into edit mode and have a real checkbox.
Why would you want a real checkbox? What's wrong with the one the CheckStateRole provides?