Changeset 846 for trunk/src/gui/kernel/qapplication.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qapplication.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 66 66 #include "qdebug.h" 67 67 #include "private/qgraphicssystemfactory_p.h" 68 #include "private/qgraphicssystem_p.h" 68 69 #include "private/qstylesheetstyle_p.h" 69 70 #include "private/qstyle_p.h" … … 71 72 #include <QtGui/qgraphicsproxywidget.h> 72 73 74 #ifdef QT_GRAPHICSSYSTEM_RUNTIME 75 #include "private/qgraphicssystem_runtime_p.h" 76 #endif 77 73 78 #include "qinputcontext.h" 74 79 #include "qkeymapper_p.h" … … 78 83 #endif 79 84 80 #if defined(Q_WS_X11) || defined(Q_ WS_S60)85 #if defined(Q_WS_X11) || defined(Q_OS_SYMBIAN) 81 86 #include "qinputcontextfactory.h" 82 87 #endif … … 90 95 91 96 #include <stdlib.h> 97 98 #if defined(Q_WS_X11) && !defined(QT_NO_EGL) 99 #include <link.h> 100 #endif 92 101 93 102 #include "qapplication_p.h" … … 123 132 { 124 133 #if defined(Q_WS_WINCE) 134 Q_INIT_RESOURCE_EXTERN(qstyle_wince) 125 135 Q_INIT_RESOURCE(qstyle_wince); 126 136 #elif defined(Q_OS_SYMBIAN) 137 Q_INIT_RESOURCE_EXTERN(qstyle_s60) 127 138 Q_INIT_RESOURCE(qstyle_s60); 128 139 #else 140 Q_INIT_RESOURCE_EXTERN(qstyle) 129 141 Q_INIT_RESOURCE(qstyle); 130 142 #endif 131 143 Q_INIT_RESOURCE_EXTERN(qmessagebox) 132 144 Q_INIT_RESOURCE(qmessagebox); 133 145 #if !defined(QT_NO_PRINTDIALOG) 146 Q_INIT_RESOURCE_EXTERN(qprintdialog) 134 147 Q_INIT_RESOURCE(qprintdialog); 135 148 #endif … … 139 152 QT_BEGIN_NAMESPACE 140 153 141 Q_ DECL_IMPORT externvoid qt_call_post_routines();154 Q_CORE_EXPORT void qt_call_post_routines(); 142 155 143 156 int QApplicationPrivate::app_compile_version = 0x040000; //we don't know exactly, but it's at least 4.0.0 … … 182 195 #endif 183 196 197 #ifndef QT_NO_GESTURES 184 198 gestureManager = 0; 185 199 gestureWidget = 0; 200 #endif // QT_NO_GESTURES 201 202 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 203 move_cursor = 0; 204 copy_cursor = 0; 205 link_cursor = 0; 206 #endif 207 #if defined(Q_WS_WIN) 208 ignore_cursor = 0; 209 #endif 186 210 187 211 if (!self) … … 432 456 QGraphicsSystem *QApplicationPrivate::graphics_system = 0; // default graphics system 433 457 QString QApplicationPrivate::graphics_system_name; // graphics system id - for delayed initialization 458 bool QApplicationPrivate::runtime_graphics_system = false; 434 459 435 460 Q_GLOBAL_STATIC(QMutex, applicationFontMutex) … … 455 480 int qt_antialiasing_threshold = -1; 456 481 static int drag_time = 500; 482 #ifndef QT_GUI_DRAG_DISTANCE 483 #define QT_GUI_DRAG_DISTANCE 4 484 #endif 457 485 #ifdef Q_OS_SYMBIAN 458 486 // The screens are a bit too small to for your thumb when using only 4 pixels drag distance. 459 static int drag_distance = 8;487 static int drag_distance = 12; //XXX move to qplatformdefs.h 460 488 #else 461 static int drag_distance = 4;489 static int drag_distance = QT_GUI_DRAG_DISTANCE; 462 490 #endif 463 491 static Qt::LayoutDirection layout_direction = Qt::LeftToRight; … … 472 500 bool QApplicationPrivate::widgetCount = false; 473 501 bool QApplicationPrivate::load_testability = false; 502 QString QApplicationPrivate::qmljs_debug_arguments; 474 503 #ifdef QT_KEYPAD_NAVIGATION 475 504 # ifdef Q_OS_SYMBIAN … … 488 517 if (!widget) 489 518 return false; 490 #if defined(Q_WS_MAC) // Fake alien behavior on the Mac :) 491 return !widget->isWindow() && widget->window()->testAttribute(Qt::WA_DontShowOnScreen); 492 #elif defined(Q_WS_QWS) 519 #if defined(Q_WS_QWS) 493 520 return !widget->isWindow() 494 521 # ifdef Q_BACKINGSTORE_SUBSURFACES … … 545 572 if (arg == "-qdevel" || arg == "-qdebug") { 546 573 // obsolete argument 574 } else if (arg.indexOf("-qmljsdebugger=", 0) != -1) { 575 qmljs_debug_arguments = QString::fromLocal8Bit(arg.right(arg.length() - 15)); 547 576 } else if (arg.indexOf("-style=", 0) != -1) { 548 577 s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower()); … … 650 679 \o -graphicssystem, sets the backend to be used for on-screen widgets 651 680 and QPixmaps. Available options are \c{raster} and \c{opengl}. 681 \o -qmljsdebugger=, activates the QML/JS debugger with a specified port. 682 The value must be of format port:1234[,block], where block is optional 683 and will make the application wait until a debugger connects to it. 652 684 \endlist 653 685 … … 658 690 that is shown. 659 691 \o -fn or \c -font \e font, defines the application font. The font 660 should be specified using an X logical font description. 692 should be specified using an X logical font description. Note that 693 this option is ignored when Qt is built with fontconfig support enabled. 661 694 \o -bg or \c -background \e color, sets the default background color 662 695 and an application palette (light and dark shades are calculated). … … 684 717 \endlist 685 718 719 \section1 X11 Notes 720 721 If QApplication fails to open the X11 display, it will terminate 722 the process. This behavior is consistent with most X11 723 applications. 724 686 725 \sa arguments() 687 726 */ … … 752 791 { Q_D(QApplication); d->construct(); QApplicationPrivate::app_compile_version = _internal;} 753 792 793 #if defined(Q_WS_X11) && !defined(QT_NO_EGL) 794 static int qt_matchLibraryName(dl_phdr_info *info, size_t, void *data) 795 { 796 const char *name = static_cast<const char *>(data); 797 return strstr(info->dlpi_name, name) != 0; 798 } 799 #endif 754 800 755 801 /*! … … 766 812 qt_is_gui_used = (qt_appType != QApplication::Tty); 767 813 process_cmdline(); 814 // the environment variable has the lowest precedence of runtime graphicssystem switches 815 if (graphics_system_name.isEmpty()) 816 graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM")); 817 818 #if defined(Q_WS_X11) && !defined(QT_NO_EGL) 819 if (graphics_system_name.isEmpty()) { 820 bool linksWithMeeGoTouch = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libmeegotouchcore")); 821 bool linksWithMeeGoGraphicsSystemHelper = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libQtMeeGoGraphicsSystemHelper")); 822 823 if (linksWithMeeGoTouch && !linksWithMeeGoGraphicsSystemHelper) { 824 qWarning("Running non-meego graphics system enabled MeeGo touch, forcing native graphicssystem\n"); 825 graphics_system_name = QLatin1String("native"); 826 } 827 } 828 #endif 829 768 830 // Must be called before initialize() 769 831 qt_init(this, qt_appType … … 778 840 extern void qt_gui_eval_init(uint); 779 841 qt_gui_eval_init(application_type); 842 #endif 843 844 #if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE) 845 symbianInit(); 780 846 #endif 781 847 … … 786 852 typedef void (*TasInitialize)(void); 787 853 TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); 854 #ifdef Q_OS_SYMBIAN 855 // resolving method by name does not work on Symbian OS so need to use ordinal 856 if(!initFunction) { 857 initFunction = (TasInitialize)testLib.resolve("1"); 858 } 859 #endif 788 860 if (initFunction) { 789 861 initFunction(); … … 879 951 880 952 extern void qInitDrawhelperAsm(); 953 extern void qInitImageConversions(); 881 954 extern int qRegisterGuiVariant(); 882 955 extern int qUnregisterGuiVariant(); … … 936 1009 // Set up which span functions should be used in raster engine... 937 1010 qInitDrawhelperAsm(); 1011 // and QImage conversion functions 1012 qInitImageConversions(); 938 1013 939 1014 #ifndef QT_NO_WHEELEVENT … … 1028 1103 QApplicationPrivate::is_app_closing = true; 1029 1104 QApplicationPrivate::is_app_running = false; 1030 1031 delete qt_desktopWidget;1032 qt_desktopWidget = 0;1033 1034 #ifndef QT_NO_CLIPBOARD1035 delete qt_clipboard;1036 qt_clipboard = 0;1037 #endif1038 1105 1039 1106 delete QWidgetPrivate::mapper; … … 1052 1119 } 1053 1120 1121 delete qt_desktopWidget; 1122 qt_desktopWidget = 0; 1123 1124 #ifndef QT_NO_CLIPBOARD 1125 delete qt_clipboard; 1126 qt_clipboard = 0; 1127 #endif 1128 1129 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 1130 delete d->move_cursor; d->move_cursor = 0; 1131 delete d->copy_cursor; d->copy_cursor = 0; 1132 delete d->link_cursor; d->link_cursor = 0; 1133 #endif 1134 #if defined(Q_WS_WIN) 1135 delete d->ignore_cursor; d->ignore_cursor = 0; 1136 #endif 1137 1054 1138 delete QApplicationPrivate::app_pal; 1055 1139 QApplicationPrivate::app_pal = 0; … … 1075 1159 delete QApplicationPrivate::app_icon; 1076 1160 QApplicationPrivate::app_icon = 0; 1161 delete QApplicationPrivate::graphics_system; 1162 QApplicationPrivate::graphics_system = 0; 1077 1163 #ifndef QT_NO_CURSOR 1078 1164 d->cursor_list.clear(); … … 1347 1433 // 1348 1434 QString style; 1349 if (!QApplicationPrivate::styleOverride.isEmpty()) 1435 #ifdef QT_BUILD_INTERNAL 1436 QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE")); 1437 #else 1438 QString envStyle; 1439 #endif 1440 if (!QApplicationPrivate::styleOverride.isEmpty()) { 1350 1441 style = QApplicationPrivate::styleOverride; 1351 else 1442 } else if (!envStyle.isEmpty()) { 1443 style = envStyle; 1444 } else { 1352 1445 style = QApplicationPrivate::desktopStyleKey(); 1446 } 1353 1447 1354 1448 QStyle *&app_style = QApplicationPrivate::app_style; … … 1533 1627 \c{"raster"} and \c{"opengl"}. 1534 1628 1535 This function call overrides both the application commandline 1536 \c{-graphicssystem} switch and the configure \c{-graphicssystem} switch. 1537 1538 \warning This function must be called before the QApplication constructor 1629 There are several ways to set the graphics backend, in order of decreasing 1630 precedence: 1631 \list 1632 \o the application commandline \c{-graphicssystem} switch 1633 \o QApplication::setGraphicsSystem() 1634 \o the QT_GRAPHICSSYSTEM environment variable 1635 \o the Qt configure \c{-graphicssystem} switch 1636 \endlist 1637 If the highest precedence switch sets an invalid name, the error will be 1638 ignored and the default backend will be used. 1639 1640 \warning This function is only effective before the QApplication constructor 1539 1641 is called. 1540 1642 … … 1544 1646 void QApplication::setGraphicsSystem(const QString &system) 1545 1647 { 1546 QApplicationPrivate::graphics_system_name = system; 1648 #ifdef QT_GRAPHICSSYSTEM_RUNTIME 1649 if (QApplicationPrivate::graphics_system_name == QLatin1String("runtime")) { 1650 QRuntimeGraphicsSystem *r = 1651 static_cast<QRuntimeGraphicsSystem *>(QApplicationPrivate::graphics_system); 1652 r->setGraphicsSystem(system); 1653 } else 1654 #endif 1655 QApplicationPrivate::graphics_system_name = system; 1547 1656 } 1548 1657 … … 2197 2306 bool did_close = true; 2198 2307 QWidget *w; 2199 while ((w = activeModalWidget()) && did_close) {2200 if (!w->isVisible())2308 while ((w = activeModalWidget()) && did_close) { 2309 if (!w->isVisible() || w->data->is_closing) 2201 2310 break; 2202 2311 did_close = w->close(); … … 2205 2314 for (int i = 0; did_close && i < list.size(); ++i) { 2206 2315 w = list.at(i); 2207 if (w->isVisible() && w->windowType() != Qt::Desktop) { 2316 if (w->isVisible() 2317 && w->windowType() != Qt::Desktop 2318 && !w->data->is_closing) { 2208 2319 did_close = w->close(); 2209 2320 list = QApplication::topLevelWidgets(); … … 2294 2405 " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); 2295 2406 } 2407 #if defined(Q_WS_MAC) 2408 static const char *application_menu_strings[] = { 2409 QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Services"), 2410 QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide %1"), 2411 QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide Others"), 2412 QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Show All"), 2413 QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Preferences..."), 2414 QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Quit %1"), 2415 QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","About %1") 2416 }; 2417 QString qt_mac_applicationmenu_string(int type) 2418 { 2419 QString menuString = QString::fromLatin1(application_menu_strings[type]); 2420 QString translated = qApp->translate("QMenuBar", application_menu_strings[type]); 2421 if (translated != menuString) 2422 return translated; 2423 else 2424 return qApp->translate("MAC_APPLICATION_MENU", 2425 application_menu_strings[type]); 2426 } 2427 #endif 2296 2428 #endif 2297 2429 … … 2322 2454 setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight); 2323 2455 #endif 2456 #if defined(QT_MAC_USE_COCOA) 2457 qt_mac_post_retranslateAppMenu(); 2458 #endif 2324 2459 QWidgetList list = topLevelWidgets(); 2325 2460 for (int i = 0; i < list.size(); ++i) { … … 2328 2463 postEvent(w, new QEvent(QEvent::LanguageChange)); 2329 2464 } 2465 #ifndef Q_OS_WIN 2466 } else if (e->type() == QEvent::LocaleChange) { 2467 // on Windows the event propagation is taken care by the 2468 // WM_SETTINGCHANGE event handler. 2469 QWidgetList list = topLevelWidgets(); 2470 for (int i = 0; i < list.size(); ++i) { 2471 QWidget *w = list.at(i); 2472 if (!(w->windowType() == Qt::Desktop)) { 2473 if (!w->testAttribute(Qt::WA_SetLocale)) 2474 w->d_func()->setLocale_helper(QLocale(), true); 2475 } 2476 } 2477 #endif 2330 2478 } else if (e->type() == QEvent::Timer) { 2331 2479 QTimerEvent *te = static_cast<QTimerEvent*>(e); … … 2456 2604 } 2457 2605 2606 #ifdef QT_MAC_USE_COCOA 2607 // In case the user clicked on a child window, we need to 2608 // reestablish the stacking order of the window so 2609 // it pops in front of other child windows in cocoa: 2610 qt_cocoaStackChildWindowOnTopOfOtherChildren(window); 2611 #endif 2612 2458 2613 for(int i = 0; i < toBeDeactivated.size(); ++i) { 2459 2614 QWidget *w = toBeDeactivated.at(i); … … 2690 2845 #elif defined(Q_WS_X11) 2691 2846 qt_x11_enforce_cursor(cursorWidget, true); 2692 #elif defined(Q_ WS_S60)2847 #elif defined(Q_OS_SYMBIAN) 2693 2848 qt_symbian_set_cursor(cursorWidget, true); 2694 2849 #elif defined(Q_WS_PM) … … 2998 3153 } 2999 3154 3000 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_ PM)3155 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_PM) 3001 3156 /* 3002 3157 This function should only be called when the widget changes visibility, i.e. … … 3058 3213 #endif // QT_NO_CURSOR 3059 3214 } 3060 #endif // Q_WS_WIN || Q_WS_ PM || Q_WS_X113215 #endif // Q_WS_WIN || Q_WS_X11 || Q_WS_MAC || Q_WS_PM 3061 3216 3062 3217 /*! … … 3465 3620 void QApplication::setLayoutDirection(Qt::LayoutDirection direction) 3466 3621 { 3467 if (layout_direction == direction )3622 if (layout_direction == direction || direction == Qt::LayoutDirectionAuto) 3468 3623 return; 3469 3624 … … 3641 3796 } 3642 3797 3798 #ifndef QT_NO_GESTURES 3643 3799 // walk through parents and check for gestures 3644 3800 if (d->gestureManager) { … … 3685 3841 } 3686 3842 } 3687 3843 #endif // QT_NO_GESTURES 3688 3844 3689 3845 // User input and window activation makes tooltips sleep … … 4190 4346 break; 4191 4347 4348 #ifndef QT_NO_GESTURES 4192 4349 case QEvent::NativeGesture: 4193 4350 { … … 4243 4400 for (int i = 0; i < gestures.size(); ++i) { 4244 4401 QGesture *g = gestures.at(i); 4245 if ((res && eventAccepted) || (!eventAccepted && ge.isAccepted(g))) { 4402 // Ignore res [event return value] because handling of multiple gestures 4403 // packed into a single QEvent depends on not consuming the event 4404 if (eventAccepted || ge.isAccepted(g)) { 4246 4405 // if the gesture was accepted, mark the target widget for it 4247 4406 gestureEvent->d_func()->targetWidgets[g->gestureType()] = w; 4248 4407 gestureEvent->setAccepted(g, true); 4249 } else if (!eventAccepted && !ge.isAccepted(g)){4408 } else { 4250 4409 // if the gesture was explicitly ignored by the application, 4251 4410 // put it back so a parent can get it … … 4268 4427 break; 4269 4428 } 4429 #endif // QT_NO_GESTURES 4270 4430 default: 4271 4431 res = d->notify_helper(receiver, e); … … 5209 5369 */ 5210 5370 5371 #ifndef QT_NO_IM 5211 5372 // ************************************************************************ 5212 5373 // Input Method support … … 5217 5378 with \a inputContext. 5218 5379 5380 Qt takes ownership of the given \a inputContext. 5381 5219 5382 \sa inputContext() 5220 5383 */ … … 5222 5385 { 5223 5386 #ifndef QT_NO_IM 5224 Q_D(QApplication);5225 Q_UNUSED(d);// only static members being used.5387 if (inputContext == QApplicationPrivate::inputContext) 5388 return; 5226 5389 if (!inputContext) { 5227 5390 qWarning("QApplication::setInputContext: called with 0 input context"); 5228 5391 return; 5229 5392 } 5230 delete d->inputContext; 5231 d->inputContext = inputContext; 5393 delete QApplicationPrivate::inputContext; 5394 QApplicationPrivate::inputContext = inputContext; 5395 QApplicationPrivate::inputContext->setParent(this); 5232 5396 #endif 5233 5397 } … … 5256 5420 that->d_func()->inputContext = qic; 5257 5421 } 5258 #elif defined(Q_ WS_S60)5422 #elif defined(Q_OS_SYMBIAN) 5259 5423 if (!d->inputContext) { 5260 5424 QApplication *that = const_cast<QApplication *>(this); 5261 that->d_func()->inputContext = QInputContextFactory::create(QString::fromLatin1("coefep"), that); 5425 const QStringList keys = QInputContextFactory::keys(); 5426 // Try hbim and coefep first, then try others. 5427 if (keys.contains(QLatin1String("hbim"))) { 5428 that->d_func()->inputContext = QInputContextFactory::create(QLatin1String("hbim"), that); 5429 } else if (keys.contains(QLatin1String("coefep"))) { 5430 that->d_func()->inputContext = QInputContextFactory::create(QLatin1String("coefep"), that); 5431 } else { 5432 for (int c = 0; c < keys.size() && !d->inputContext; ++c) { 5433 that->d_func()->inputContext = QInputContextFactory::create(keys[c], that); 5434 } 5435 } 5262 5436 } 5263 5437 #endif … … 5267 5441 #endif 5268 5442 } 5443 #endif // QT_NO_IM 5269 5444 5270 5445 //Returns the current platform used by keyBindings … … 5694 5869 } 5695 5870 5871 #ifndef QT_NO_GESTURES 5696 5872 QGestureManager* QGestureManager::instance() 5697 5873 { 5698 QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); 5699 if (!qAppPriv->gestureManager) 5700 qAppPriv->gestureManager = new QGestureManager(qApp); 5701 return qAppPriv->gestureManager; 5874 if (QApplicationPrivate *qAppPriv = QApplicationPrivate::instance()) { 5875 if (!qAppPriv->gestureManager) 5876 qAppPriv->gestureManager = new QGestureManager(qApp); 5877 return qAppPriv->gestureManager; 5878 } 5879 return 0; 5880 } 5881 #endif // QT_NO_GESTURES 5882 5883 // These pixmaps approximate the images in the Windows User Interface Guidelines. 5884 5885 // XPM 5886 5887 static const char * const move_xpm[] = { 5888 "11 20 3 1", 5889 ". c None", 5890 #if defined(Q_WS_WIN) 5891 "a c #000000", 5892 "X c #FFFFFF", // Windows cursor is traditionally white 5893 #else 5894 "a c #FFFFFF", 5895 "X c #000000", // X11 cursor is traditionally black 5896 #endif 5897 "aa.........", 5898 "aXa........", 5899 "aXXa.......", 5900 "aXXXa......", 5901 "aXXXXa.....", 5902 "aXXXXXa....", 5903 "aXXXXXXa...", 5904 "aXXXXXXXa..", 5905 "aXXXXXXXXa.", 5906 "aXXXXXXXXXa", 5907 "aXXXXXXaaaa", 5908 "aXXXaXXa...", 5909 "aXXaaXXa...", 5910 "aXa..aXXa..", 5911 "aa...aXXa..", 5912 "a.....aXXa.", 5913 "......aXXa.", 5914 ".......aXXa", 5915 ".......aXXa", 5916 "........aa."}; 5917 5918 #ifdef Q_WS_WIN 5919 /* XPM */ 5920 static const char * const ignore_xpm[] = { 5921 "24 30 3 1", 5922 ". c None", 5923 "a c #000000", 5924 "X c #FFFFFF", 5925 "aa......................", 5926 "aXa.....................", 5927 "aXXa....................", 5928 "aXXXa...................", 5929 "aXXXXa..................", 5930 "aXXXXXa.................", 5931 "aXXXXXXa................", 5932 "aXXXXXXXa...............", 5933 "aXXXXXXXXa..............", 5934 "aXXXXXXXXXa.............", 5935 "aXXXXXXaaaa.............", 5936 "aXXXaXXa................", 5937 "aXXaaXXa................", 5938 "aXa..aXXa...............", 5939 "aa...aXXa...............", 5940 "a.....aXXa..............", 5941 "......aXXa.....XXXX.....", 5942 ".......aXXa..XXaaaaXX...", 5943 ".......aXXa.XaaaaaaaaX..", 5944 "........aa.XaaaXXXXaaaX.", 5945 "...........XaaaaX..XaaX.", 5946 "..........XaaXaaaX..XaaX", 5947 "..........XaaXXaaaX.XaaX", 5948 "..........XaaX.XaaaXXaaX", 5949 "..........XaaX..XaaaXaaX", 5950 "...........XaaX..XaaaaX.", 5951 "...........XaaaXXXXaaaX.", 5952 "............XaaaaaaaaX..", 5953 ".............XXaaaaXX...", 5954 "...............XXXX....."}; 5955 #endif 5956 5957 /* XPM */ 5958 static const char * const copy_xpm[] = { 5959 "24 30 3 1", 5960 ". c None", 5961 "a c #000000", 5962 "X c #FFFFFF", 5963 #if defined(Q_WS_WIN) // Windows cursor is traditionally white 5964 "aa......................", 5965 "aXa.....................", 5966 "aXXa....................", 5967 "aXXXa...................", 5968 "aXXXXa..................", 5969 "aXXXXXa.................", 5970 "aXXXXXXa................", 5971 "aXXXXXXXa...............", 5972 "aXXXXXXXXa..............", 5973 "aXXXXXXXXXa.............", 5974 "aXXXXXXaaaa.............", 5975 "aXXXaXXa................", 5976 "aXXaaXXa................", 5977 "aXa..aXXa...............", 5978 "aa...aXXa...............", 5979 "a.....aXXa..............", 5980 "......aXXa..............", 5981 ".......aXXa.............", 5982 ".......aXXa.............", 5983 "........aa...aaaaaaaaaaa", 5984 #else 5985 "XX......................", 5986 "XaX.....................", 5987 "XaaX....................", 5988 "XaaaX...................", 5989 "XaaaaX..................", 5990 "XaaaaaX.................", 5991 "XaaaaaaX................", 5992 "XaaaaaaaX...............", 5993 "XaaaaaaaaX..............", 5994 "XaaaaaaaaaX.............", 5995 "XaaaaaaXXXX.............", 5996 "XaaaXaaX................", 5997 "XaaXXaaX................", 5998 "XaX..XaaX...............", 5999 "XX...XaaX...............", 6000 "X.....XaaX..............", 6001 "......XaaX..............", 6002 ".......XaaX.............", 6003 ".......XaaX.............", 6004 "........XX...aaaaaaaaaaa", 6005 #endif 6006 ".............aXXXXXXXXXa", 6007 ".............aXXXXXXXXXa", 6008 ".............aXXXXaXXXXa", 6009 ".............aXXXXaXXXXa", 6010 ".............aXXaaaaaXXa", 6011 ".............aXXXXaXXXXa", 6012 ".............aXXXXaXXXXa", 6013 ".............aXXXXXXXXXa", 6014 ".............aXXXXXXXXXa", 6015 ".............aaaaaaaaaaa"}; 6016 6017 /* XPM */ 6018 static const char * const link_xpm[] = { 6019 "24 30 3 1", 6020 ". c None", 6021 "a c #000000", 6022 "X c #FFFFFF", 6023 #if defined(Q_WS_WIN) // Windows cursor is traditionally white 6024 "aa......................", 6025 "aXa.....................", 6026 "aXXa....................", 6027 "aXXXa...................", 6028 "aXXXXa..................", 6029 "aXXXXXa.................", 6030 "aXXXXXXa................", 6031 "aXXXXXXXa...............", 6032 "aXXXXXXXXa..............", 6033 "aXXXXXXXXXa.............", 6034 "aXXXXXXaaaa.............", 6035 "aXXXaXXa................", 6036 "aXXaaXXa................", 6037 "aXa..aXXa...............", 6038 "aa...aXXa...............", 6039 "a.....aXXa..............", 6040 "......aXXa..............", 6041 ".......aXXa.............", 6042 ".......aXXa.............", 6043 "........aa...aaaaaaaaaaa", 6044 #else 6045 "XX......................", 6046 "XaX.....................", 6047 "XaaX....................", 6048 "XaaaX...................", 6049 "XaaaaX..................", 6050 "XaaaaaX.................", 6051 "XaaaaaaX................", 6052 "XaaaaaaaX...............", 6053 "XaaaaaaaaX..............", 6054 "XaaaaaaaaaX.............", 6055 "XaaaaaaXXXX.............", 6056 "XaaaXaaX................", 6057 "XaaXXaaX................", 6058 "XaX..XaaX...............", 6059 "XX...XaaX...............", 6060 "X.....XaaX..............", 6061 "......XaaX..............", 6062 ".......XaaX.............", 6063 ".......XaaX.............", 6064 "........XX...aaaaaaaaaaa", 6065 #endif 6066 ".............aXXXXXXXXXa", 6067 ".............aXXXaaaaXXa", 6068 ".............aXXXXaaaXXa", 6069 ".............aXXXaaaaXXa", 6070 ".............aXXaaaXaXXa", 6071 ".............aXXaaXXXXXa", 6072 ".............aXXaXXXXXXa", 6073 ".............aXXXaXXXXXa", 6074 ".............aXXXXXXXXXa", 6075 ".............aaaaaaaaaaa"}; 6076 6077 QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) 6078 { 6079 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 6080 if (!move_cursor) { 6081 move_cursor = new QPixmap((const char **)move_xpm); 6082 copy_cursor = new QPixmap((const char **)copy_xpm); 6083 link_cursor = new QPixmap((const char **)link_xpm); 6084 #ifdef Q_WS_WIN 6085 ignore_cursor = new QPixmap((const char **)ignore_xpm); 6086 #endif 6087 } 6088 6089 switch (cshape) { 6090 case Qt::DragMoveCursor: 6091 return *move_cursor; 6092 case Qt::DragCopyCursor: 6093 return *copy_cursor; 6094 case Qt::DragLinkCursor: 6095 return *link_cursor; 6096 #ifdef Q_WS_WIN 6097 case Qt::ForbiddenCursor: 6098 return *ignore_cursor; 6099 #endif 6100 default: 6101 break; 6102 } 6103 #endif 6104 return QPixmap(); 6105 } 6106 6107 QString QApplicationPrivate::qmljsDebugArgumentsString() 6108 { 6109 return qmljs_debug_arguments; 5702 6110 } 5703 6111
Note:
See TracChangeset
for help on using the changeset viewer.