472 bool qt_in_tab_key_event = false; |
472 bool qt_in_tab_key_event = false; |
473 int qt_antialiasing_threshold = -1; |
473 int qt_antialiasing_threshold = -1; |
474 static int drag_time = 500; |
474 static int drag_time = 500; |
475 #ifdef Q_OS_SYMBIAN |
475 #ifdef Q_OS_SYMBIAN |
476 // The screens are a bit too small to for your thumb when using only 4 pixels drag distance. |
476 // The screens are a bit too small to for your thumb when using only 4 pixels drag distance. |
477 static int drag_distance = 8; |
477 static int drag_distance = 12; |
478 #else |
478 #else |
479 static int drag_distance = 4; |
479 static int drag_distance = 4; |
480 #endif |
480 #endif |
481 static Qt::LayoutDirection layout_direction = Qt::LeftToRight; |
481 static Qt::LayoutDirection layout_direction = Qt::LeftToRight; |
482 QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut |
482 QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut |
1053 d->eventDispatcher->closingDown(); |
1053 d->eventDispatcher->closingDown(); |
1054 d->eventDispatcher = 0; |
1054 d->eventDispatcher = 0; |
1055 QApplicationPrivate::is_app_closing = true; |
1055 QApplicationPrivate::is_app_closing = true; |
1056 QApplicationPrivate::is_app_running = false; |
1056 QApplicationPrivate::is_app_running = false; |
1057 |
1057 |
1058 delete qt_desktopWidget; |
|
1059 qt_desktopWidget = 0; |
|
1060 |
|
1061 #ifndef QT_NO_CLIPBOARD |
|
1062 delete qt_clipboard; |
|
1063 qt_clipboard = 0; |
|
1064 #endif |
|
1065 |
|
1066 #if defined(Q_WS_X11) || defined(Q_WS_WIN) |
|
1067 delete d->move_cursor; d->move_cursor = 0; |
|
1068 delete d->copy_cursor; d->copy_cursor = 0; |
|
1069 delete d->link_cursor; d->link_cursor = 0; |
|
1070 #endif |
|
1071 #if defined(Q_WS_WIN) |
|
1072 delete d->ignore_cursor; d->ignore_cursor = 0; |
|
1073 #endif |
|
1074 |
|
1075 delete QWidgetPrivate::mapper; |
|
1076 QWidgetPrivate::mapper = 0; |
|
1077 |
|
1078 // delete all widgets |
1058 // delete all widgets |
1079 if (QWidgetPrivate::allWidgets) { |
1059 if (QWidgetPrivate::allWidgets) { |
1080 QWidgetSet *mySet = QWidgetPrivate::allWidgets; |
1060 QWidgetSet *mySet = QWidgetPrivate::allWidgets; |
1081 QWidgetPrivate::allWidgets = 0; |
1061 QWidgetPrivate::allWidgets = 0; |
1082 for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) { |
1062 for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) { |
1084 if (!w->parent()) // window |
1064 if (!w->parent()) // window |
1085 w->destroy(true, true); |
1065 w->destroy(true, true); |
1086 } |
1066 } |
1087 delete mySet; |
1067 delete mySet; |
1088 } |
1068 } |
|
1069 |
|
1070 delete qt_desktopWidget; |
|
1071 qt_desktopWidget = 0; |
|
1072 |
|
1073 #ifndef QT_NO_CLIPBOARD |
|
1074 delete qt_clipboard; |
|
1075 qt_clipboard = 0; |
|
1076 #endif |
|
1077 |
|
1078 #if defined(Q_WS_X11) || defined(Q_WS_WIN) |
|
1079 delete d->move_cursor; d->move_cursor = 0; |
|
1080 delete d->copy_cursor; d->copy_cursor = 0; |
|
1081 delete d->link_cursor; d->link_cursor = 0; |
|
1082 #endif |
|
1083 #if defined(Q_WS_WIN) |
|
1084 delete d->ignore_cursor; d->ignore_cursor = 0; |
|
1085 #endif |
|
1086 |
|
1087 delete QWidgetPrivate::mapper; |
|
1088 QWidgetPrivate::mapper = 0; |
1089 |
1089 |
1090 delete QApplicationPrivate::app_pal; |
1090 delete QApplicationPrivate::app_pal; |
1091 QApplicationPrivate::app_pal = 0; |
1091 QApplicationPrivate::app_pal = 0; |
1092 delete QApplicationPrivate::sys_pal; |
1092 delete QApplicationPrivate::sys_pal; |
1093 QApplicationPrivate::sys_pal = 0; |
1093 QApplicationPrivate::sys_pal = 0; |
2537 for (int i = 0; i < toBeActivated.size(); ++i) { |
2537 for (int i = 0; i < toBeActivated.size(); ++i) { |
2538 QWidget *w = toBeActivated.at(i); |
2538 QWidget *w = toBeActivated.at(i); |
2539 sendSpontaneousEvent(w, &windowActivate); |
2539 sendSpontaneousEvent(w, &windowActivate); |
2540 sendSpontaneousEvent(w, &activationChange); |
2540 sendSpontaneousEvent(w, &activationChange); |
2541 } |
2541 } |
|
2542 |
|
2543 #ifdef QT_MAC_USE_COCOA |
|
2544 // In case the user clicked on a child window, we need to |
|
2545 // reestablish the stacking order of the window so |
|
2546 // it pops in front of other child windows in cocoa: |
|
2547 qt_cocoaStackChildWindowOnTopOfOtherChildren(window); |
|
2548 #endif |
2542 |
2549 |
2543 for(int i = 0; i < toBeDeactivated.size(); ++i) { |
2550 for(int i = 0; i < toBeDeactivated.size(); ++i) { |
2544 QWidget *w = toBeDeactivated.at(i); |
2551 QWidget *w = toBeDeactivated.at(i); |
2545 sendSpontaneousEvent(w, &windowDeactivate); |
2552 sendSpontaneousEvent(w, &windowDeactivate); |
2546 sendSpontaneousEvent(w, &activationChange); |
2553 sendSpontaneousEvent(w, &activationChange); |
5789 } |
5796 } |
5790 |
5797 |
5791 #ifndef QT_NO_GESTURES |
5798 #ifndef QT_NO_GESTURES |
5792 QGestureManager* QGestureManager::instance() |
5799 QGestureManager* QGestureManager::instance() |
5793 { |
5800 { |
5794 QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); |
5801 if (QApplicationPrivate *qAppPriv = QApplicationPrivate::instance()) { |
5795 if (!qAppPriv->gestureManager) |
5802 if (!qAppPriv->gestureManager) |
5796 qAppPriv->gestureManager = new QGestureManager(qApp); |
5803 qAppPriv->gestureManager = new QGestureManager(qApp); |
5797 return qAppPriv->gestureManager; |
5804 return qAppPriv->gestureManager; |
|
5805 } |
|
5806 return 0; |
5798 } |
5807 } |
5799 #endif // QT_NO_GESTURES |
5808 #endif // QT_NO_GESTURES |
5800 |
5809 |
5801 // These pixmaps approximate the images in the Windows User Interface Guidelines. |
5810 // These pixmaps approximate the images in the Windows User Interface Guidelines. |
5802 |
5811 |