PDA

View Full Version : How to add 2 column of RadioButtons in qtableview ?



smichaud
22nd July 2011, 20:54
Hi guys,

what's the best thing I must you to add RadioButtons in qtableview ? Is-it better with ItemDelegate or with the method setIndexWidget()?

Do you have an example ? I didn't find any of the web.

Thx.
Sylvain Michaud

Lykurg
23rd July 2011, 08:52
With setIndexWidget it is faster (to achieve) and easier, but using a item delegate is much more sophisticated, faster in runtime if you have more of it, and simply the way to do. You will find a star delegate at the documentation. Also see QStylePainter::drawControl() with QStyle::CE_RadioButton.