found this in the source code for qabstractspinbox.cpp
#ifndef QT_NO_WHEELEVENT
{
const int steps = (event->delta() > 0 ? 1 : -1);
if (stepEnabled() & (steps > 0 ? StepUpEnabled : StepDownEnabled))
stepBy(event->modifiers() & Qt::ControlModifier ? steps * 10 : steps);
event->accept();
}
#endif
#ifndef QT_NO_WHEELEVENT
void QAbstractSpinBox::wheelEvent(QWheelEvent *event)
{
const int steps = (event->delta() > 0 ? 1 : -1);
if (stepEnabled() & (steps > 0 ? StepUpEnabled : StepDownEnabled))
stepBy(event->modifiers() & Qt::ControlModifier ? steps * 10 : steps);
event->accept();
}
#endif
To copy to clipboard, switch view to plain text mode
and this inside the keyPressEvent function:
switch (event->key()) {
case Qt::Key_PageUp:
case Qt::Key_PageDown:
steps *= 10;
switch (event->key()) {
case Qt::Key_PageUp:
case Qt::Key_PageDown:
steps *= 10;
To copy to clipboard, switch view to plain text mode
looks like I don't really need to waste time reimplementing this as it already kind of does what I want it to do. I wish that were documented somewhere. That's a nice feature to know about...
Bookmarks