checkbox indicator size not change
Unsolved
General and Desktop
-
Have you tried other values? The indicator cant be wider or higher than the widget itself. Does a
w/h
of 15px work?Edit:
There are also some reports, that the indicator size resets when setting custom colors. Does the indicator size work, if you remove the custom colors or set the color again in your local style?
https://stackoverflow.com/questions/46134100/how-to-set-the-size-of-a-qcheckboxs-indicator/46163040
-
@Pl45m4
The same is true of removing the color-applied value.void WToggleMenu::InitListitem() { for (int n = 0; n < 20; n++) { usrCntrListItem* pListItem = new usrCntrListItem(QString("%1").arg(n)); QListWidgetItem* pWidgetItem = new QListWidgetItem(this->ui.listWidget); pWidgetItem->setSizeHint(pListItem->sizeHint()); this->ui.listWidget->addItem(pWidgetItem); this->ui.listWidget->setItemWidget(pWidgetItem, pListItem); } } usrCntrListItem::usrCntrListItem(QString strTitle) { ui.setupUi(this); this->ui.label->setText(strTitle); this->ui.label->setFixedHeight(60); //this->ui.checkBox->setStyleSheet("margin-left:1%; margin-right:1%;"); this->ui.checkBox->setStyleSheet("\ QCheckBox::indicator\ {\ width: 50px;\ height: 50px;\ }"); }
The indicator area does not look large on the screen, but the area is large when clicked.
It's also checked when you click outside the check box.
Is it a bug?I think it's a problem with the set sizehint.
Can you check the entire code?