How can I add a checkbox/radiobutton/combobox to a QTableWidget or a QListWidget?
相关问题
- Sorting 3 numbers without branching [closed]
- QML: Cannot read property 'xxx' of undefin
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
相关文章
- ubuntu20.4中c#通过c++库调用python脚本
- Qt槽函数自动执行多遍
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
For a checkbox using the item's setCheckState method should do what you need both for list and table widgets. See if code below would work for you:
List widget:
Table widget:
You can use delegates (QItemDelegate) for other types of editor's widgets, example is here: Spin Box Delegate Example.
I hope this helps.
you can add checkbox like this too
// call it like
There is two methods:
and
They allow to insert any widget and other controls that inherit QWidget. Checkbox/radio button/combobox do inherit from
QWidget
.