I have a custom QComboBox using a model in which I set some QStandardItems. I made these items checkable:Qt Code:
item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);To copy to clipboard, switch view to plain text mode
The problem is when I deploy my app for Android, the checkboxes are so small I cannot even click on them. That's why I would like to set a style for them, so my question is: how do I get the checkbox objects of a QStandardItem so I can call QWidget::setStyle() on them?
Additional issue to be taken into account: the checkboxes do not always show up depending on the OS, so I'm using one of these workarounds:
- set another style for my QComboBox, which will display the checkboxes correctly
- set a custom QStyledItemDelegate with a redefined QStyledItemDelegate::paint() method, as suggested in a Stackoverflow thread
Bookmarks