--Code changes

-Upgrade to Qt 5.11.2
This commit is contained in:
Person
2018-09-29 13:28:03 -07:00
parent 0a27382c8a
commit 2d27eecd5e
3 changed files with 60 additions and 12 deletions

View File

@ -210,16 +210,37 @@ bool SpinBox::eventFilter(QObject* o, QEvent* e)
{
if (e->type() == QEvent::Wheel)
{
//Take special action for shift to reduce the scroll amount. Control already
//increases it automatically.
if (QWheelEvent* we = dynamic_cast<QWheelEvent*>(e))
{
Qt::KeyboardModifiers mod = we->modifiers();
bool shift = QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
if (mod.testFlag(Qt::ShiftModifier))
setSingleStep(m_SmallStep);
if (we->angleDelta().ry() > 0)
{
if (shift)
{
setSingleStep(m_SmallStep);
setValue(value() + m_SmallStep);
}
else
{
setSingleStep(m_Step);
setValue(value() + (ctrl ? m_Step * 10 : m_Step));
}
}
else
setSingleStep(m_Step);
{
if (shift)
{
setSingleStep(m_SmallStep);
setValue(value() - m_SmallStep);
}
else
{
setSingleStep(m_Step);
setValue(value() - (ctrl ? m_Step * 10 : m_Step));
}
}
}
}
}