C++ :QCheckBox设置不可点击
要设置QCheckBox不可点击,可以使用setChecked()函数将其状态设置为不可用,并将其setEnabled()函数设置为false。
示例代码如下:
QCheckBox *checkBox = new QCheckBox("Checkbox", this); checkBox->setChecked(true); checkBox->setEnabled(false);
这将创建一个名为"Checkbox"的QCheckBox,并将其状态设置为选中。然后,通过setEnabled(false)函数将其设置为不可用,这样用户就无法点击它了。
原文地址: http://www.cveoy.top/t/topic/idd6 著作权归作者所有。请勿转载和采集!