Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道如何在 QTreeWidgetItem 中制作一个不可编辑的复选框但保持 QTreeWidgetItem 可选择?
不要设置Qt.ItemIsUserCheckable项目的标志,而是设置checkStatetoQt.Checked或Qt.Unchecked。
Qt.ItemIsUserCheckable
checkState
Qt.Checked
Qt.Unchecked
复选框的存在和用户可检查性是独立的。
尝试这个:
setCheckState(0,Qt::Checked);