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 ** |
50 #include "qt_s60_p.h" |
50 #include "qt_s60_p.h" |
51 #include "private/qevent_p.h" |
51 #include "private/qevent_p.h" |
52 #include "qstring.h" |
52 #include "qstring.h" |
53 #include "qdebug.h" |
53 #include "qdebug.h" |
54 #include "qimage.h" |
54 #include "qimage.h" |
|
55 #include "qcombobox.h" |
55 #include "private/qkeymapper_p.h" |
56 #include "private/qkeymapper_p.h" |
56 #include "private/qfont_p.h" |
57 #include "private/qfont_p.h" |
57 #ifndef QT_NO_STYLE_S60 |
58 #ifndef QT_NO_STYLE_S60 |
58 #include "private/qs60style_p.h" |
59 #include "private/qs60style_p.h" |
59 #endif |
60 #endif |
69 # if !defined(QT_NO_IM) |
70 # if !defined(QT_NO_IM) |
70 # include "qinputcontext.h" |
71 # include "qinputcontext.h" |
71 # include <private/qcoefepinputcontext_p.h> |
72 # include <private/qcoefepinputcontext_p.h> |
72 # endif |
73 # endif |
73 # include <private/qs60mainapplication_p.h> |
74 # include <private/qs60mainapplication_p.h> |
|
75 # include <centralrepository.h> |
74 #endif |
76 #endif |
75 |
77 |
76 #include "private/qstylesheetstyle_p.h" |
78 #include "private/qstylesheetstyle_p.h" |
77 |
79 |
78 #include <hal.h> |
80 #include <hal.h> |
594 */ |
596 */ |
595 |
597 |
596 TUint s60Keysym = QApplicationPrivate::resolveS60ScanCode(keyEvent.iScanCode, |
598 TUint s60Keysym = QApplicationPrivate::resolveS60ScanCode(keyEvent.iScanCode, |
597 keyEvent.iCode); |
599 keyEvent.iCode); |
598 int keyCode; |
600 int keyCode; |
599 if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) { |
601 if (s60Keysym == EKeyNull){ //some key events have 0 in iCode, for them iScanCode should be used |
|
602 keyCode = qt_keymapper_private()->mapS60ScanCodesToQt(keyEvent.iScanCode); |
|
603 } else if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) { |
600 // Normal characters keys. |
604 // Normal characters keys. |
601 keyCode = s60Keysym; |
605 keyCode = s60Keysym; |
602 } else { |
606 } else { |
603 // Special S60 keys. |
607 // Special S60 keys. |
604 keyCode = qt_keymapper_private()->mapS60KeyToQt(s60Keysym); |
608 keyCode = qt_keymapper_private()->mapS60KeyToQt(s60Keysym); |
805 } |
809 } |
806 #endif |
810 #endif |
807 |
811 |
808 void QSymbianControl::Draw(const TRect& controlRect) const |
812 void QSymbianControl::Draw(const TRect& controlRect) const |
809 { |
813 { |
|
814 // Set flag to avoid calling DrawNow in window surface |
|
815 QWidget *window = qwidget->window(); |
|
816 Q_ASSERT(window); |
|
817 QTLWExtra *topExtra = window->d_func()->maybeTopData(); |
|
818 Q_ASSERT(topExtra); |
|
819 if (!topExtra->inExpose) { |
|
820 topExtra->inExpose = true; |
|
821 QRect exposeRect = qt_TRect2QRect(controlRect); |
|
822 qwidget->d_func()->syncBackingStore(exposeRect); |
|
823 topExtra->inExpose = false; |
|
824 } |
|
825 |
810 QWindowSurface *surface = qwidget->windowSurface(); |
826 QWindowSurface *surface = qwidget->windowSurface(); |
811 QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL; |
827 QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL; |
812 |
828 |
813 if (!engine) |
829 if (!engine) |
814 return; |
830 return; |
914 if (oldPos != newPos) { |
928 if (oldPos != newPos) { |
915 QRect cr = qwidget->geometry(); |
929 QRect cr = qwidget->geometry(); |
916 cr.moveTopLeft(newPos); |
930 cr.moveTopLeft(newPos); |
917 qwidget->data->crect = cr; |
931 qwidget->data->crect = cr; |
918 QTLWExtra *top = qwidget->d_func()->maybeTopData(); |
932 QTLWExtra *top = qwidget->d_func()->maybeTopData(); |
919 if (top) |
933 if (top && (qwidget->windowState() & (~Qt::WindowActive)) == Qt::WindowNoState) |
920 top->normalGeometry = cr; |
934 top->normalGeometry.moveTopLeft(newPos); |
921 if (qwidget->isVisible()) { |
935 if (qwidget->isVisible()) { |
922 QMoveEvent e(newPos, oldPos); |
936 QMoveEvent e(newPos, oldPos); |
923 qt_sendSpontaneousEvent(qwidget, &e); |
937 qt_sendSpontaneousEvent(qwidget, &e); |
924 } else { |
938 } else { |
925 QMoveEvent * e = new QMoveEvent(newPos, oldPos); |
939 QMoveEvent * e = new QMoveEvent(newPos, oldPos); |
928 } |
942 } |
929 } |
943 } |
930 |
944 |
931 void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) |
945 void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) |
932 { |
946 { |
933 if (m_ignoreFocusChanged) |
947 if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop) |
934 return; |
948 return; |
935 |
949 |
936 // Popups never get focused, but still receive the FocusChanged when they are hidden. |
950 // Popups never get focused, but still receive the FocusChanged when they are hidden. |
937 if (QApplicationPrivate::popupWidgets != 0 |
951 if (QApplicationPrivate::popupWidgets != 0 |
938 || (qwidget->windowType() & Qt::Popup) == Qt::Popup) |
952 || (qwidget->windowType() & Qt::Popup) == Qt::Popup) |
950 |
964 |
951 QApplication::setActiveWindow(qwidget->window()); |
965 QApplication::setActiveWindow(qwidget->window()); |
952 qwidget->d_func()->setWindowIcon_sys(true); |
966 qwidget->d_func()->setWindowIcon_sys(true); |
953 qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); |
967 qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); |
954 #ifdef Q_WS_S60 |
968 #ifdef Q_WS_S60 |
955 // If widget is fullscreen, hide status pane and button container |
969 // If widget is fullscreen/minimized, hide status pane and button container otherwise show them. |
956 // otherwise show them. |
970 CEikStatusPane *statusPane = S60->statusPane(); |
957 CEikStatusPane* statusPane = S60->statusPane(); |
971 CEikButtonGroupContainer *buttonGroup = S60->buttonGroupContainer(); |
958 CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); |
972 TBool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); |
959 bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; |
973 if (statusPane) |
960 if (statusPane && (bool)statusPane->IsVisible() == isFullscreen) |
974 statusPane->MakeVisible(visible); |
961 statusPane->MakeVisible(!isFullscreen); |
975 if (buttonGroup) { |
962 if (buttonGroup && (bool)buttonGroup->IsVisible() == isFullscreen) |
976 // Visibility |
963 buttonGroup->MakeVisible(!isFullscreen); |
977 const TBool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; |
|
978 const TBool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; |
|
979 buttonGroup->MakeVisible(visible || (isFullscreen && cbaVisibilityHint)); |
|
980 |
|
981 // Responsiviness |
|
982 CEikCba *cba = static_cast<CEikCba *>( buttonGroup->ButtonGroup() ); // downcast from MEikButtonGroup |
|
983 TUint cbaFlags = cba->ButtonGroupFlags(); |
|
984 if(qwidget->windowFlags() & Qt::WindowSoftkeysRespondHint) |
|
985 cbaFlags |= EAknCBAFlagRespondWhenInvisible; |
|
986 else |
|
987 cbaFlags &= ~EAknCBAFlagRespondWhenInvisible; |
|
988 cba->SetButtonGroupFlags(cbaFlags); |
|
989 } |
964 #endif |
990 #endif |
965 } else if (QApplication::activeWindow() == qwidget->window()) { |
991 } else if (QApplication::activeWindow() == qwidget->window()) { |
966 if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) { |
992 if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) { |
967 QWidget *fw = QApplication::focusWidget(); |
993 QWidget *fw = QApplication::focusWidget(); |
968 if (fw) { |
994 if (fw) { |
976 QApplication::setActiveWindow(0); |
1002 QApplication::setActiveWindow(0); |
977 } |
1003 } |
978 // else { We don't touch the active window unless we were explicitly activated or deactivated } |
1004 // else { We don't touch the active window unless we were explicitly activated or deactivated } |
979 } |
1005 } |
980 |
1006 |
|
1007 void QSymbianControl::handleClientAreaChange() |
|
1008 { |
|
1009 const bool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; |
|
1010 if (qwidget->isFullScreen() && !cbaVisibilityHint) { |
|
1011 SetExtentToWholeScreen(); |
|
1012 } else if (qwidget->isMaximized() || (qwidget->isFullScreen() && cbaVisibilityHint)) { |
|
1013 TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); |
|
1014 SetExtent(r.iTl, r.Size()); |
|
1015 } else if (!qwidget->isMinimized()) { // Normal geometry |
|
1016 if (!qwidget->testAttribute(Qt::WA_Resized)) { |
|
1017 qwidget->adjustSize(); |
|
1018 qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize |
|
1019 } |
|
1020 if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) { |
|
1021 TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); |
|
1022 SetPosition(r.iTl); |
|
1023 qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position |
|
1024 } |
|
1025 } |
|
1026 } |
|
1027 |
981 void QSymbianControl::HandleResourceChange(int resourceType) |
1028 void QSymbianControl::HandleResourceChange(int resourceType) |
982 { |
1029 { |
983 switch (resourceType) { |
1030 switch (resourceType) { |
984 case KInternalStatusPaneChange: |
1031 case KInternalStatusPaneChange: |
985 if (qwidget->isFullScreen()) { |
1032 handleClientAreaChange(); |
986 SetExtentToWholeScreen(); |
|
987 } else if (qwidget->isMaximized()) { |
|
988 TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); |
|
989 SetExtent(r.iTl, r.Size()); |
|
990 } |
|
991 if (IsFocused() && IsVisible()) { |
1033 if (IsFocused() && IsVisible()) { |
992 qwidget->d_func()->setWindowIcon_sys(true); |
1034 qwidget->d_func()->setWindowIcon_sys(true); |
993 qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); |
1035 qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); |
994 } |
1036 } |
995 break; |
1037 break; |
1195 else { |
1236 else { |
1196 S60->hasTouchscreen = true; |
1237 S60->hasTouchscreen = true; |
1197 S60->virtualMouseRequired = false; |
1238 S60->virtualMouseRequired = false; |
1198 } |
1239 } |
1199 |
1240 |
|
1241 S60->avkonComponentsSupportTransparency = false; |
|
1242 |
|
1243 #ifdef Q_WS_S60 |
|
1244 TUid KCRUidAvkon = { 0x101F876E }; |
|
1245 TUint32 KAknAvkonTransparencyEnabled = 0x0000000D; |
|
1246 |
|
1247 CRepository* repository = 0; |
|
1248 TRAP(err, repository = CRepository::NewL(KCRUidAvkon)); |
|
1249 |
|
1250 if(err == KErrNone) { |
|
1251 TInt value = 0; |
|
1252 err = repository->Get(KAknAvkonTransparencyEnabled, value); |
|
1253 if(err == KErrNone) { |
|
1254 S60->avkonComponentsSupportTransparency = (value==1) ? true : false; |
|
1255 } |
|
1256 } |
|
1257 #endif |
|
1258 |
1200 if (touch) { |
1259 if (touch) { |
1201 QApplicationPrivate::navigationMode = Qt::NavigationModeNone; |
1260 QApplicationPrivate::navigationMode = Qt::NavigationModeNone; |
1202 } else { |
1261 } else { |
1203 QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional; |
1262 QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional; |
1204 } |
1263 } |
1348 app_do_modal = qt_modal_stack != 0; |
1407 app_do_modal = qt_modal_stack != 0; |
1349 } |
1408 } |
1350 |
1409 |
1351 void QApplicationPrivate::openPopup(QWidget *popup) |
1410 void QApplicationPrivate::openPopup(QWidget *popup) |
1352 { |
1411 { |
|
1412 if (popup && qobject_cast<QComboBox *>(popup->parentWidget())) |
|
1413 static_cast<QSymbianControl *>(popup->effectiveWinId())->FadeBehindPopup(ETrue); |
|
1414 |
1353 if (!QApplicationPrivate::popupWidgets) |
1415 if (!QApplicationPrivate::popupWidgets) |
1354 QApplicationPrivate::popupWidgets = new QWidgetList; |
1416 QApplicationPrivate::popupWidgets = new QWidgetList; |
1355 QApplicationPrivate::popupWidgets->append(popup); |
1417 QApplicationPrivate::popupWidgets->append(popup); |
1356 |
|
1357 |
1418 |
1358 // Cancel focus widget pointer capture and long tap timer |
1419 // Cancel focus widget pointer capture and long tap timer |
1359 if (QApplication::focusWidget()) { |
1420 if (QApplication::focusWidget()) { |
1360 static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); |
1421 static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); |
1361 QApplication::focusWidget()->effectiveWinId()->SetPointerCapture(false); |
1422 QApplication::focusWidget()->effectiveWinId()->SetPointerCapture(false); |
1414 QWidgetPrivate::keyboardGrabber->grabKeyboard(); |
1478 QWidgetPrivate::keyboardGrabber->grabKeyboard(); |
1415 |
1479 |
1416 QWidget *fw = QApplicationPrivate::active_window ? QApplicationPrivate::active_window->focusWidget() |
1480 QWidget *fw = QApplicationPrivate::active_window ? QApplicationPrivate::active_window->focusWidget() |
1417 : q_func()->focusWidget(); |
1481 : q_func()->focusWidget(); |
1418 if (fw) { |
1482 if (fw) { |
|
1483 if(fw->window()->isModal()) // restore pointer capture for modal window |
|
1484 fw->effectiveWinId()->SetPointerCapture(true); |
|
1485 |
1419 if (fw != q_func()->focusWidget()) { |
1486 if (fw != q_func()->focusWidget()) { |
1420 fw->setFocus(Qt::PopupFocusReason); |
1487 fw->setFocus(Qt::PopupFocusReason); |
1421 } else { |
1488 } else { |
1422 QFocusEvent e(QEvent::FocusIn, Qt::PopupFocusReason); |
1489 QFocusEvent e(QEvent::FocusIn, Qt::PopupFocusReason); |
1423 q_func()->sendEvent(fw, &e); |
1490 q_func()->sendEvent(fw, &e); |
1547 if (symbianEventFilter(event)) |
1623 if (symbianEventFilter(event)) |
1548 return 1; |
1624 return 1; |
1549 |
1625 |
1550 switch (event->type()) { |
1626 switch (event->type()) { |
1551 case QSymbianEvent::WindowServerEvent: |
1627 case QSymbianEvent::WindowServerEvent: |
1552 return d->symbianProcessWsEvent(event->windowServerEvent()); |
1628 return d->symbianProcessWsEvent(event); |
1553 case QSymbianEvent::CommandEvent: |
1629 case QSymbianEvent::CommandEvent: |
1554 return d->symbianHandleCommand(event->command()); |
1630 return d->symbianHandleCommand(event); |
1555 case QSymbianEvent::ResourceChangeEvent: |
1631 case QSymbianEvent::ResourceChangeEvent: |
1556 return d->symbianResourceChange(event->resourceChangeType()); |
1632 return d->symbianResourceChange(event); |
1557 default: |
1633 default: |
1558 return -1; |
1634 return -1; |
1559 } |
1635 } |
1560 } |
1636 } |
1561 |
1637 |
1562 int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event) |
1638 int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent) |
1563 { |
1639 { |
1564 // Qt event handling. Handle some events regardless of if the handle is in our |
1640 // Qt event handling. Handle some events regardless of if the handle is in our |
1565 // widget map or not. |
1641 // widget map or not. |
|
1642 const TWsEvent *event = symbianEvent->windowServerEvent(); |
1566 CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle()); |
1643 CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle()); |
1567 const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control); |
1644 const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control); |
1568 switch (event->Type()) { |
1645 switch (event->Type()) { |
1569 case EEventPointerEnter: |
1646 case EEventPointerEnter: |
1570 if (controlInMap) |
1647 if (controlInMap) { |
|
1648 callSymbianEventFilters(symbianEvent); |
1571 return 1; // Qt::Enter will be generated in HandlePointerL |
1649 return 1; // Qt::Enter will be generated in HandlePointerL |
|
1650 } |
1572 break; |
1651 break; |
1573 case EEventPointerExit: |
1652 case EEventPointerExit: |
1574 if (controlInMap) { |
1653 if (controlInMap) { |
|
1654 if (callSymbianEventFilters(symbianEvent)) |
|
1655 return 1; |
1575 if (S60) { |
1656 if (S60) { |
1576 // mouseEvent outside our window, send leave event to last focused widget |
1657 // mouseEvent outside our window, send leave event to last focused widget |
1577 QMouseEvent mEvent(QEvent::Leave, S60->lastPointerEventPos, S60->lastCursorPos, |
1658 QMouseEvent mEvent(QEvent::Leave, S60->lastPointerEventPos, S60->lastCursorPos, |
1578 Qt::NoButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); |
1659 Qt::NoButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); |
1579 if (S60->lastPointerEventTarget) |
1660 if (S60->lastPointerEventTarget) |
1582 } |
1663 } |
1583 return 1; |
1664 return 1; |
1584 } |
1665 } |
1585 break; |
1666 break; |
1586 case EEventScreenDeviceChanged: |
1667 case EEventScreenDeviceChanged: |
|
1668 if (callSymbianEventFilters(symbianEvent)) |
|
1669 return 1; |
1587 if (S60) |
1670 if (S60) |
1588 S60->updateScreenSize(); |
1671 S60->updateScreenSize(); |
1589 if (qt_desktopWidget) { |
1672 if (qt_desktopWidget) { |
1590 QSize oldSize = qt_desktopWidget->size(); |
1673 QSize oldSize = qt_desktopWidget->size(); |
1591 qt_desktopWidget->data->crect.setWidth(S60->screenWidthInPixels); |
1674 qt_desktopWidget->data->crect.setWidth(S60->screenWidthInPixels); |
1594 QApplication::sendEvent(qt_desktopWidget, &e); |
1677 QApplication::sendEvent(qt_desktopWidget, &e); |
1595 } |
1678 } |
1596 return 0; // Propagate to CONE |
1679 return 0; // Propagate to CONE |
1597 case EEventWindowVisibilityChanged: |
1680 case EEventWindowVisibilityChanged: |
1598 if (controlInMap) { |
1681 if (controlInMap) { |
|
1682 if (callSymbianEventFilters(symbianEvent)) |
|
1683 return 1; |
1599 const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged(); |
1684 const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged(); |
1600 QWidget *w = QWidgetPrivate::mapper->value(control); |
1685 QWidget *w = QWidgetPrivate::mapper->value(control); |
1601 if (!w->d_func()->maybeTopData()) |
1686 if (!w->d_func()->maybeTopData()) |
1602 break; |
1687 break; |
1603 if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) { |
1688 if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) { |
1604 delete w->d_func()->topData()->backingStore; |
1689 delete w->d_func()->topData()->backingStore; |
1605 w->d_func()->topData()->backingStore = 0; |
1690 w->d_func()->topData()->backingStore = 0; |
1606 // :QTP:QT-2506:remove this when QT-2506 is fixed |
1691 // In order to ensure that any resources used by the window surface |
1607 if (S60) |
1692 // are immediately freed, we flush the WSERV command buffer. |
1608 S60->wsSession().Flush(); |
1693 S60->wsSession().Flush(); |
1609 } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) |
1694 } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) |
1610 && !w->d_func()->maybeBackingStore()) { |
1695 && !w->d_func()->maybeBackingStore()) { |
1611 w->d_func()->topData()->backingStore = new QWidgetBackingStore(w); |
1696 w->d_func()->topData()->backingStore = new QWidgetBackingStore(w); |
1612 w->d_func()->invalidateBuffer(w->rect()); |
1697 w->d_func()->invalidateBuffer(w->rect()); |
1613 w->repaint(); |
1698 w->repaint(); |
1614 } |
1699 } |
1615 return 1; |
1700 return 1; |
1616 } |
1701 } |
1617 break; |
1702 break; |
1618 case EEventFocusGained: |
1703 case EEventFocusGained: |
|
1704 if (callSymbianEventFilters(symbianEvent)) |
|
1705 return 1; |
1619 #ifndef QT_NO_CURSOR |
1706 #ifndef QT_NO_CURSOR |
1620 //re-enable mouse interaction |
1707 //re-enable mouse interaction |
1621 if (S60->mouseInteractionEnabled) { |
1708 if (S60->mouseInteractionEnabled) { |
1622 #ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS |
1709 #ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS |
1623 if (S60->brokenPointerCursors) |
1710 if (S60->brokenPointerCursors) |
1627 S60->wsSession().SetPointerCursorMode(EPointerCursorNormal); |
1714 S60->wsSession().SetPointerCursorMode(EPointerCursorNormal); |
1628 } |
1715 } |
1629 #endif |
1716 #endif |
1630 break; |
1717 break; |
1631 case EEventFocusLost: |
1718 case EEventFocusLost: |
|
1719 if (callSymbianEventFilters(symbianEvent)) |
|
1720 return 1; |
1632 #ifndef QT_NO_CURSOR |
1721 #ifndef QT_NO_CURSOR |
1633 //disable mouse as may be moving to application that does not support it |
1722 //disable mouse as may be moving to application that does not support it |
1634 if (S60->mouseInteractionEnabled) { |
1723 if (S60->mouseInteractionEnabled) { |
1635 #ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS |
1724 #ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS |
1636 if (S60->brokenPointerCursors) |
1725 if (S60->brokenPointerCursors) |
1678 partially achieved by deriving from CAknAppUi. Currently, exit, |
1767 partially achieved by deriving from CAknAppUi. Currently, exit, |
1679 menu and softkey commands are handled. |
1768 menu and softkey commands are handled. |
1680 |
1769 |
1681 \sa s60EventFilter(), s60ProcessEvent() |
1770 \sa s60EventFilter(), s60ProcessEvent() |
1682 */ |
1771 */ |
1683 int QApplicationPrivate::symbianHandleCommand(int command) |
1772 int QApplicationPrivate::symbianHandleCommand(const QSymbianEvent *symbianEvent) |
1684 { |
1773 { |
1685 Q_Q(QApplication); |
1774 Q_Q(QApplication); |
1686 int ret = 0; |
1775 int ret = 0; |
|
1776 |
|
1777 if (callSymbianEventFilters(symbianEvent)) |
|
1778 return 1; |
|
1779 |
|
1780 int command = symbianEvent->command(); |
1687 |
1781 |
1688 switch (command) { |
1782 switch (command) { |
1689 #ifdef Q_WS_S60 |
1783 #ifdef Q_WS_S60 |
1690 case EAknSoftkeyExit: { |
1784 case EAknSoftkeyExit: { |
1691 QCloseEvent ev; |
1785 QCloseEvent ev; |
1722 Handles the resource change specified by \a type. |
1816 Handles the resource change specified by \a type. |
1723 |
1817 |
1724 Currently, KEikDynamicLayoutVariantSwitch and |
1818 Currently, KEikDynamicLayoutVariantSwitch and |
1725 KAknsMessageSkinChange are handled. |
1819 KAknsMessageSkinChange are handled. |
1726 */ |
1820 */ |
1727 int QApplicationPrivate::symbianResourceChange(int type) |
1821 int QApplicationPrivate::symbianResourceChange(const QSymbianEvent *symbianEvent) |
1728 { |
1822 { |
1729 int ret = 0; |
1823 int ret = 0; |
|
1824 |
|
1825 int type = symbianEvent->resourceChangeType(); |
1730 |
1826 |
1731 switch (type) { |
1827 switch (type) { |
1732 #ifdef Q_WS_S60 |
1828 #ifdef Q_WS_S60 |
1733 case KEikDynamicLayoutVariantSwitch: |
1829 case KEikDynamicLayoutVariantSwitch: |
1734 { |
1830 { |
|
1831 if (callSymbianEventFilters(symbianEvent)) |
|
1832 return 1; |
1735 if (S60) |
1833 if (S60) |
1736 S60->updateScreenSize(); |
1834 S60->updateScreenSize(); |
1737 |
1835 |
1738 #ifndef QT_NO_STYLE_S60 |
1836 #ifndef QT_NO_STYLE_S60 |
1739 QS60Style *s60Style = 0; |
1837 QS60Style *s60Style = 0; |