Dkrii
7th February 2019, 21:57
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.
13019
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());
Added after 1 15 minutes:
This was the soluton
item->GetWidget()->setAttribute(Qt::WA_TransparentForMouseEvents);
See picture below that shows 3 rows.
13019
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());
Added after 1 15 minutes:
This was the soluton
item->GetWidget()->setAttribute(Qt::WA_TransparentForMouseEvents);