1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
942 num = |
942 num = |
943 settings.value(QLatin1String("cursorFlashTime"), |
943 settings.value(QLatin1String("cursorFlashTime"), |
944 QApplication::cursorFlashTime()).toInt(); |
944 QApplication::cursorFlashTime()).toInt(); |
945 QApplication::setCursorFlashTime(num); |
945 QApplication::setCursorFlashTime(num); |
946 |
946 |
|
947 #ifndef QT_NO_WHEELEVENT |
947 num = |
948 num = |
948 settings.value(QLatin1String("wheelScrollLines"), |
949 settings.value(QLatin1String("wheelScrollLines"), |
949 QApplication::wheelScrollLines()).toInt(); |
950 QApplication::wheelScrollLines()).toInt(); |
950 QApplication::setWheelScrollLines(num); |
951 QApplication::setWheelScrollLines(num); |
|
952 #endif |
951 |
953 |
952 QString colorspec = settings.value(QLatin1String("colorSpec"), |
954 QString colorspec = settings.value(QLatin1String("colorSpec"), |
953 QVariant(QLatin1String("default"))).toString(); |
955 QVariant(QLatin1String("default"))).toString(); |
954 if (colorspec == QLatin1String("normal")) |
956 if (colorspec == QLatin1String("normal")) |
955 QApplication::setColorSpec(QApplication::NormalColor); |
957 QApplication::setColorSpec(QApplication::NormalColor); |
4399 // send the event to the widget or its ancestors |
4401 // send the event to the widget or its ancestors |
4400 { |
4402 { |
4401 QWidget* popup = qApp->activePopupWidget(); |
4403 QWidget* popup = qApp->activePopupWidget(); |
4402 if (popup && window() != popup) |
4404 if (popup && window() != popup) |
4403 popup->close(); |
4405 popup->close(); |
|
4406 #ifndef QT_NO_WHEELEVENT |
4404 QWheelEvent e(pos, globalPos, delta, buttons, modifiers, orient); |
4407 QWheelEvent e(pos, globalPos, delta, buttons, modifiers, orient); |
4405 if (QApplication::sendSpontaneousEvent(widget, &e)) |
4408 if (QApplication::sendSpontaneousEvent(widget, &e)) |
|
4409 #endif |
4406 return true; |
4410 return true; |
4407 } |
4411 } |
4408 |
4412 |
4409 // send the event to the widget that has the focus or its ancestors, if different |
4413 // send the event to the widget that has the focus or its ancestors, if different |
4410 if (widget != qApp->focusWidget() && (widget = qApp->focusWidget())) { |
4414 if (widget != qApp->focusWidget() && (widget = qApp->focusWidget())) { |
4411 if (widget && !widget->internalWinId()) |
4415 if (widget && !widget->internalWinId()) |
4412 pos = widget->mapFromGlobal(globalPos); |
4416 pos = widget->mapFromGlobal(globalPos); |
4413 QWidget* popup = qApp->activePopupWidget(); |
4417 QWidget* popup = qApp->activePopupWidget(); |
4414 if (popup && widget != popup) |
4418 if (popup && widget != popup) |
4415 popup->hide(); |
4419 popup->hide(); |
|
4420 #ifndef QT_NO_WHEELEVENT |
4416 QWheelEvent e(pos, globalPos, delta, buttons, modifiers, orient); |
4421 QWheelEvent e(pos, globalPos, delta, buttons, modifiers, orient); |
4417 if (QApplication::sendSpontaneousEvent(widget, &e)) |
4422 if (QApplication::sendSpontaneousEvent(widget, &e)) |
|
4423 #endif |
4418 return true; |
4424 return true; |
4419 } |
4425 } |
4420 return false; |
4426 return false; |
4421 } |
4427 } |
4422 |
4428 |
5311 int QApplication::keyboardInputInterval() |
5317 int QApplication::keyboardInputInterval() |
5312 { |
5318 { |
5313 return QApplicationPrivate::keyboard_input_time; |
5319 return QApplicationPrivate::keyboard_input_time; |
5314 } |
5320 } |
5315 |
5321 |
|
5322 #ifndef QT_NO_WHEELEVENT |
5316 void QApplication::setWheelScrollLines(int n) |
5323 void QApplication::setWheelScrollLines(int n) |
5317 { |
5324 { |
5318 QApplicationPrivate::wheel_scroll_lines = n; |
5325 QApplicationPrivate::wheel_scroll_lines = n; |
5319 } |
5326 } |
5320 |
5327 |
5321 int QApplication::wheelScrollLines() |
5328 int QApplication::wheelScrollLines() |
5322 { |
5329 { |
5323 return QApplicationPrivate::wheel_scroll_lines; |
5330 return QApplicationPrivate::wheel_scroll_lines; |
5324 } |
5331 } |
|
5332 #endif |
5325 |
5333 |
5326 void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable) |
5334 void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable) |
5327 { |
5335 { |
5328 switch (effect) { |
5336 switch (effect) { |
5329 case Qt::UI_AnimateMenu: |
5337 case Qt::UI_AnimateMenu: |