When I add a widget to a row in a QTreeView using setIndexWidget(), the QAbstractItemView::entered signal, used to detect when the mouse hovers over a row, does not fire unless the mouse is over the part of the row that the QWidget does not occupy.
See picture below that shows 3 rows.
hovermodel.PNG
When the mouse enters the white space it works, but if it enters the green space (the QWidget) it does not. How do I fix this?
This is how the QWidget is put in the row. The QWidget is necessary because I need a clickable button in each row
CustomItem* item= new CustomItem(_uiDoc, *sketch);
parent->appendRow(item);
setIndexWidget(item->index(), item->GetWidget());
CustomItem* item= new CustomItem(_uiDoc, *sketch);
parent->appendRow(item);
setIndexWidget(item->index(), item->GetWidget());
To copy to clipboard, switch view to plain text mode
Added after 1 15 minutes:
This was the soluton
item->GetWidget()->setAttribute(Qt::WA_TransparentForMouseEvents);
item->GetWidget()->setAttribute(Qt::WA_TransparentForMouseEvents);
To copy to clipboard, switch view to plain text mode
Bookmarks