Changeset 769 for trunk/src/gui/kernel/qapplication_s60.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qapplication_s60.cpp
r651 r769 53 53 #include "qdebug.h" 54 54 #include "qimage.h" 55 55 56 #include "private/qkeymapper_p.h" 56 57 #include "private/qfont_p.h" … … 64 65 65 66 #include "apgwgnam.h" // For CApaWindowGroupName 66 #include < MdaAudioTonePlayer.h> // For CMdaAudioToneUtility67 #include <layer.h> // For CMdaAudioToneUtility 67 68 68 69 #if defined(Q_WS_S60) … … 73 74 # include <private/qs60mainapplication_p.h> 74 75 # include <centralrepository.h> 76 75 77 #endif 76 78 … … 372 374 if (S60->curWin == this) 373 375 S60->curWin = 0; 374 if (!QApplicationPrivate::is_app_closing) 375 setFocusSafely(false); 376 if (!QApplicationPrivate::is_app_closing) { 377 QT_TRY { 378 setFocusSafely(false); 379 } QT_CATCH(const std::exception&) { 380 // ignore exceptions, nothing can be done 381 } 382 } 376 383 S60->appUi()->RemoveFromStack(this); 377 384 delete m_longTapDetector; … … 401 408 { 402 409 QApplicationPrivate *d = QApplicationPrivate::instance(); 410 411 412 413 414 415 403 416 404 417 QRect screenGeometry = qApp->desktop()->screenGeometry(qwidget); 405 418 406 while (d->appAllTouchPoints.count() <= event->PointerNumber()) 407 d->appAllTouchPoints.append(QTouchEvent::TouchPoint(d->appAllTouchPoints.count())); 419 QList<QTouchEvent::TouchPoint> points = d->appAllTouchPoints; 420 while (points.count() <= event->PointerNumber()) 421 points.append(QTouchEvent::TouchPoint(points.count())); 408 422 409 423 Qt::TouchPointStates allStates = 0; 410 for (int i = 0; i < d->appAllTouchPoints.count(); ++i) {411 QTouchEvent::TouchPoint &touchPoint = d->appAllTouchPoints[i];424 for (int i = 0; i < oints.count(); ++i) { 425 QTouchEvent::TouchPoint &touchPoint = oints[i]; 412 426 413 427 if (touchPoint.id() == event->PointerNumber()) { … … 434 448 touchPoint.setState(state); 435 449 436 QPointF screenPos = QPointF(event->iPosition.iX, event->iPosition.iY);450 QPointF screenPos = ); 437 451 touchPoint.setScreenPos(screenPos); 438 452 touchPoint.setNormalizedPos(QPointF(screenPos.x() / screenGeometry.width(), 439 453 screenPos.y() / screenGeometry.height())); 440 454 441 touchPoint.setPressure( event->Pressure() / qreal(d->maxTouchPressure));455 touchPoint.setPressure(); 442 456 } else if (touchPoint.state() != Qt::TouchPointReleased) { 443 457 // all other active touch points should be marked as stationary … … 451 465 // all touch points released 452 466 d->appAllTouchPoints.clear(); 467 468 453 469 } 454 470 455 471 QApplicationPrivate::translateRawTouchEvent(qwidget, 456 472 QTouchEvent::TouchScreen, 457 d->appAllTouchPoints);473 oints); 458 474 } 459 475 #endif … … 533 549 sendMouseEvent(receiver, type, globalPos, button, modifiers); 534 550 } 551 552 553 554 555 556 557 558 535 559 536 560 void QSymbianControl::sendMouseEvent( … … 598 622 keyEvent.iCode); 599 623 int keyCode; 600 if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) { 624 if (s60Keysym == EKeyNull){ //some key events have 0 in iCode, for them iScanCode should be used 625 keyCode = qt_keymapper_private()->mapS60ScanCodesToQt(keyEvent.iScanCode); 626 } else if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) { 601 627 // Normal characters keys. 602 628 keyCode = s60Keysym; … … 626 652 QPoint pos = QCursor::pos(); 627 653 TPointerEvent fakeEvent; 654 628 655 TInt x = pos.x(); 629 656 TInt y = pos.y(); 630 657 if (type == EEventKeyUp) { 631 if (keyCode == Qt::Key_Select) 658 if (keyCode == Qt::Key_Select && 659 (S60->virtualMousePressedKeys & QS60Data::Select)) 632 660 fakeEvent.iType = TPointerEvent::EButton1Up; 633 661 S60->virtualMouseAccel = 1; … … 678 706 // down messages for some keys. Therefore, make sure we have a clean slate 679 707 // of pressed keys before starting a new button press. 680 if (S60->virtualMousePressedKeys != 0) { 681 S60->virtualMousePressedKeys |= QS60Data::Select; 708 if (S60->virtualMousePressedKeys & QS60Data::Select) { 682 709 return EKeyWasConsumed; 683 710 } else { … … 702 729 fakeEvent.iPosition = cpos; 703 730 fakeEvent.iParentPosition = epos; 704 HandlePointerEvent(fakeEvent); 731 if(fakeEvent.iType != -1) 732 HandlePointerEvent(fakeEvent); 705 733 return EKeyWasConsumed; 706 734 } … … 907 935 if (!slowResize && tlwExtra) 908 936 tlwExtra->inTopLevelResize = false; 937 938 939 909 940 } 910 941 } … … 965 996 #ifdef Q_WS_S60 966 997 // If widget is fullscreen/minimized, hide status pane and button container otherwise show them. 967 CEikStatusPane *statusPane = S60->statusPane();968 CEikButtonGroupContainer *buttonGroup = S60->buttonGroupContainer();998 CEikStatusPanestatusPane = S60->statusPane(); 999 CEikButtonGroupContainerbuttonGroup = S60->buttonGroupContainer(); 969 1000 TBool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); 970 1001 if (statusPane) 971 1002 statusPane->MakeVisible(visible); 972 if (buttonGroup) 973 buttonGroup->MakeVisible(visible); 1003 if (buttonGroup) { 1004 // Visibility 1005 const TBool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; 1006 const TBool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; 1007 buttonGroup->MakeVisible(visible || (isFullscreen && cbaVisibilityHint)); 1008 } 974 1009 #endif 975 1010 } else if (QApplication::activeWindow() == qwidget->window()) { 976 if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() ) {1011 if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) { 977 1012 QWidget *fw = QApplication::focusWidget(); 978 1013 if (fw) { … … 989 1024 } 990 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 991 1047 void QSymbianControl::HandleResourceChange(int resourceType) 992 1048 { 993 1049 switch (resourceType) { 994 1050 case KInternalStatusPaneChange: 995 if (qwidget->isFullScreen()) { 996 SetExtentToWholeScreen(); 997 } else if (qwidget->isMaximized()) { 998 TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); 999 SetExtent(r.iTl, r.Size()); 1000 } 1051 handleClientAreaChange(); 1001 1052 if (IsFocused() && IsVisible()) { 1002 1053 qwidget->d_func()->setWindowIcon_sys(true); … … 1010 1061 case KEikDynamicLayoutVariantSwitch: 1011 1062 { 1012 if (qwidget->isFullScreen()) { 1013 SetExtentToWholeScreen(); 1014 } else if (qwidget->isMaximized()) { 1015 TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); 1016 SetExtent(r.iTl, r.Size()); 1017 } 1063 handleClientAreaChange(); 1018 1064 break; 1019 1065 } … … 1146 1192 #endif 1147 1193 S60->wsSession().SetAutoFlush(ETrue); 1194 1195 1196 1197 1148 1198 1149 1199 S60->updateScreenSize(); … … 1209 1259 1210 1260 S60->avkonComponentsSupportTransparency = false; 1261 1211 1262 1212 1263 #ifdef Q_WS_S60 … … 1224 1275 } 1225 1276 } 1226 #endif 1277 #endif 1227 1278 1228 1279 if (touch) { … … 1379 1430 void QApplicationPrivate::openPopup(QWidget *popup) 1380 1431 { 1432 1433 1434 1381 1435 if (!QApplicationPrivate::popupWidgets) 1382 1436 QApplicationPrivate::popupWidgets = new QWidgetList; 1383 1437 QApplicationPrivate::popupWidgets->append(popup); 1384 1385 1438 1386 1439 // Cancel focus widget pointer capture and long tap timer … … 1422 1475 void QApplicationPrivate::closePopup(QWidget *popup) 1423 1476 { 1477 1478 1479 1424 1480 if (!QApplicationPrivate::popupWidgets) 1425 1481 return; … … 1445 1501 : q_func()->focusWidget(); 1446 1502 if (fw) { 1503 1504 1505 1447 1506 if (fw != q_func()->focusWidget()) { 1448 1507 fw->setFocus(Qt::PopupFocusReason); … … 1870 1929 { 1871 1930 #ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER 1931 1932 1872 1933 if (HAL::Get(HALData::EPointer3DMaxPressure, maxTouchPressure) != KErrNone) 1873 1934 maxTouchPressure = KMaxTInt;
Note:
See TracChangeset
for help on using the changeset viewer.