Home > Mobile >  How to intercept the mouse on the QSlider or QSpinBox control roller can operate?
How to intercept the mouse on the QSlider or QSpinBox control roller can operate?

Time:09-27

How to intercept the mouse on the QSlider or QSpinBox control roller can operate??

I need the mouse to click the QSlider or QSpinBox control after the mouse wheel can control the pusher or SPIN,

CodePudding user response:

Overloading QSpinBox, try the mouse respond to events,

CodePudding user response:

Rewrite wheelEvent (QWheelEvent * e)
{
If only disable its wheel events requires distributed the event to the parent controls, adding QWidgets: this sentence: wheelEvent (e);
Rather than QSpainBox: : wheelEvent (e).

If you don't need to distribute events, what all need not write
}
  • Related