Code style fix
Change-Id: I0174293421d866f3b124a9ff4344052749e8a1b9 Reviewed-by: Nie Cheng <niecheng@uniontech.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
1ff82d1eba
commit
e1d7df5ce9
@ -1230,57 +1230,49 @@ void QAbstractScrollArea::contextMenuEvent(QContextMenuEvent *e)
|
|||||||
void QAbstractScrollArea::keyPressEvent(QKeyEvent * e)
|
void QAbstractScrollArea::keyPressEvent(QKeyEvent * e)
|
||||||
{
|
{
|
||||||
Q_D(QAbstractScrollArea);
|
Q_D(QAbstractScrollArea);
|
||||||
if (false){
|
|
||||||
#ifndef QT_NO_SHORTCUT
|
|
||||||
} else if (e == QKeySequence::MoveToPreviousPage) {
|
|
||||||
d->vbar->triggerAction(QScrollBar::SliderPageStepSub);
|
|
||||||
} else if (e == QKeySequence::MoveToNextPage) {
|
|
||||||
d->vbar->triggerAction(QScrollBar::SliderPageStepAdd);
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
|
if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
|
||||||
e->ignore();
|
e->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
switch (e->key()) {
|
switch (e->key()) {
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
d->vbar->triggerAction(QScrollBar::SliderSingleStepSub);
|
d->vbar->triggerAction(QScrollBar::SliderSingleStepSub);
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Down:
|
case Qt::Key_Down:
|
||||||
d->vbar->triggerAction(QScrollBar::SliderSingleStepAdd);
|
d->vbar->triggerAction(QScrollBar::SliderSingleStepAdd);
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Left:
|
case Qt::Key_Left:
|
||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()
|
if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()
|
||||||
&& (!d->hbar->isVisible() || d->hbar->value() == d->hbar->minimum())) {
|
&& (!d->hbar->isVisible() || d->hbar->value() == d->hbar->minimum())) {
|
||||||
//if we aren't using the hbar or we are already at the leftmost point ignore
|
//if we aren't using the hbar or we are already at the leftmost point ignore
|
||||||
e->ignore();
|
e->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
d->hbar->triggerAction(
|
d->hbar->triggerAction(
|
||||||
layoutDirection() == Qt::LeftToRight
|
layoutDirection() == Qt::LeftToRight
|
||||||
? QScrollBar::SliderSingleStepSub : QScrollBar::SliderSingleStepAdd);
|
? QScrollBar::SliderSingleStepSub : QScrollBar::SliderSingleStepAdd);
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Right:
|
case Qt::Key_Right:
|
||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()
|
if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()
|
||||||
&& (!d->hbar->isVisible() || d->hbar->value() == d->hbar->maximum())) {
|
&& (!d->hbar->isVisible() || d->hbar->value() == d->hbar->maximum())) {
|
||||||
//if we aren't using the hbar or we are already at the rightmost point ignore
|
//if we aren't using the hbar or we are already at the rightmost point ignore
|
||||||
e->ignore();
|
e->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
d->hbar->triggerAction(
|
d->hbar->triggerAction(
|
||||||
layoutDirection() == Qt::LeftToRight
|
layoutDirection() == Qt::LeftToRight
|
||||||
? QScrollBar::SliderSingleStepAdd : QScrollBar::SliderSingleStepSub);
|
? QScrollBar::SliderSingleStepAdd : QScrollBar::SliderSingleStepSub);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
e->ignore();
|
e->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
e->accept();
|
e->accept();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user