For the "ignore wheel" widgets, do not leave focus on mouse leave events. This causes unintended side effects such as not being able to type in edit boxes, and is very annoying.
15 lines
288 B
C++
15 lines
288 B
C++
#include "spinBox-ignorewheel.hpp"
|
|
|
|
SpinBoxIgnoreScroll::SpinBoxIgnoreScroll(QWidget *parent) : QSpinBox(parent)
|
|
{
|
|
setFocusPolicy(Qt::StrongFocus);
|
|
}
|
|
|
|
void SpinBoxIgnoreScroll::wheelEvent(QWheelEvent * event)
|
|
{
|
|
if (!hasFocus())
|
|
event->ignore();
|
|
else
|
|
QSpinBox::wheelEvent(event);
|
|
}
|