Disable combobox scroll hijacking, and only show one event by default (rather than all)

This commit is contained in:
Marcus Huderle
2018-07-11 13:18:50 -05:00
parent 8930b2c01b
commit dc6b82b4dc
11 changed files with 158 additions and 64 deletions

16
noscrollspinbox.cpp Normal file
View File

@@ -0,0 +1,16 @@
#include "noscrollspinbox.h"
NoScrollSpinBox::NoScrollSpinBox(QWidget *parent)
: QSpinBox(parent)
{
// Don't let scrolling hijack focus.
setFocusPolicy(Qt::StrongFocus);
}
void NoScrollSpinBox::wheelEvent(QWheelEvent *event)
{
// Only allow scrolling to modify contents when it explicitly has focus.
if (hasFocus())
QSpinBox::wheelEvent(event);
}