The selection behavior is set to select rows, but only the hovered cell is highlighted. Is there any way to highlight the entire row?
相关问题
- 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++)
There are 2 ways..
Hope, It will usefull to you guys.
First, you subclass
QTableWidget/QTableView
and reimplementmouseMoveEvent
andleaveEvent
.In
custom_table_widget.cpp
, you should have:Next, you subclass
QStyledItemDelegate
. Reimplementpaint
method and add two slots to modify the hovered row. Inrow_hover_delegate.cpp
, you should have:Finally, connect the the signals/slots and set the item delegate: