[Interest] Mouse wheel problem when using a custom widget in a QTableView

Etienne Sandré-Chardonnal etienne.sandre at m4x.org
Mon Apr 14 08:55:12 CEST 2014


Dear all,

I have a custom scientific number spin box which works well alone. Amongst
other features, it automatically increments/decrements with the mouse
wheel, similarly to QDoubleSpinBox. The wheel event is reimplemented with:

//Handle mouse wheel event, which we use for spinning the value

void ScientificSpinBox::wheelEvent(QWheelEvent * event)

{

	stepBy(event->delta()/120);

	event->accept();

}



However, when I use this widget in a QTableView with a custom delegate, the
mouse wheel does close the editor and scroll the view. If I replace the
editor with a QDoubleSpinBox, it works well.

It seems the wheel event is not passed to the ScientificSpinBox. Why?

Thanks,

Etienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140414/751bb070/attachment.html>


More information about the Interest mailing list