42 #include "qplatformdefs.h" 67 #include "private/qgraphicssystemfactory_p.h" 68 #include "private/qgraphicssystem_p.h" 69 #include "private/qstylesheetstyle_p.h" 70 #include "private/qstyle_p.h" 72 #include <QtGui/qgraphicsproxywidget.h> 74 #ifdef QT_GRAPHICSSYSTEM_RUNTIME 75 #include "private/qgraphicssystem_runtime_p.h" 82 #include <private/qt_x11_p.h> 85 #if defined(Q_WS_X11) || defined(Q_OS_SYMBIAN) 92 #include <private/qthread_p.h> 94 #include <private/qfont_p.h> 98 #if defined(Q_WS_X11) && !defined(QT_NO_EGL) 109 #include "private/qgesturemanager_p.h" 111 #ifndef QT_NO_LIBRARY 125 #ifdef QT_MAC_USE_COCOA 126 #include <private/qt_cocoa_helpers_mac_p.h> 131 #if defined(Q_OS_SYMBIAN) 132 #include "qt_s60_p.h" 137 #if defined(Q_WS_WINCE) 140 #elif defined(Q_OS_SYMBIAN) 149 #if !defined(QT_NO_PRINTDIALOG) 171 bool QApplicationPrivate::inputContextBeingCreated =
false;
187 #ifndef QT_NO_SESSIONMANAGER 195 qt_compat_resolved = 0;
196 qt_tryAccelEvent = 0;
197 qt_tryComposeUnicode = 0;
198 qt_dispatchAccelEvent = 0;
200 #if defined(Q_WS_QWS) && !defined(QT_NO_DIRECTPAINTER) 204 #ifndef QT_NO_GESTURES 207 #endif // QT_NO_GESTURES 209 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 214 #if defined(Q_WS_WIN) 458 #ifndef QT_NO_STYLE_STYLESHEET 469 #if defined(Q_WS_QPA) 489 #ifndef QT_NO_WHEELEVENT 497 #ifndef QT_GUI_DRAG_DISTANCE 498 #define QT_GUI_DRAG_DISTANCE 4 517 #ifdef QT_KEYPAD_NAVIGATION 523 QWidget *QApplicationPrivate::oldEditFocus = 0;
533 #if defined(Q_WS_QWS) || defined(Q_WS_QPA) 535 # ifdef Q_BACKINGSTORE_SUBSURFACES 536 && !(widget->d_func()->maybeTopData() && widget->d_func()->maybeTopData()->
windowSurface)
549 return app_palettes();
561 #ifndef QT_NO_CLIPBOARD 578 for (i=1; i<
argc; i++) {
586 if (arg ==
"-qdevel" || arg ==
"-qdebug") {
588 }
else if (arg.
indexOf(
"-style=", 0) != -1) {
590 }
else if (arg ==
"-style" && i < argc-1) {
592 #ifndef QT_NO_SESSIONMANAGER 593 }
else if (arg ==
"-session" && i < argc-1) {
605 #ifndef QT_NO_STYLE_STYLESHEET 606 }
else if (arg ==
"-stylesheet" && i < argc -1) {
609 }
else if (arg.
indexOf(
"-stylesheet=") != -1) {
613 }
else if (
qstrcmp(arg,
"-reverse") == 0) {
616 }
else if (
qstrcmp(arg,
"-widgetcount") == 0) {
618 }
else if (
qstrcmp(arg,
"-testability") == 0) {
620 }
else if (arg ==
"-graphicssystem" && i < argc-1) {
804 #if defined(Q_WS_X11) && !defined(QT_NO_EGL) 807 const char *
name =
static_cast<const char *
>(
data);
808 return strstr(info->dlpi_name, name) != 0;
826 if (graphics_system_name.isEmpty())
829 #if defined(Q_WS_X11) && !defined(QT_NO_EGL) 830 if (graphics_system_name.isEmpty()) {
831 bool linksWithMeeGoTouch = dl_iterate_phdr(
qt_matchLibraryName, const_cast<char *>(
"libmeegotouchcore"));
832 bool linksWithMeeGoGraphicsSystemHelper = dl_iterate_phdr(
qt_matchLibraryName, const_cast<char *>(
"libQtMeeGoGraphicsSystemHelper"));
834 if (linksWithMeeGoTouch && !linksWithMeeGoGraphicsSystemHelper) {
835 qWarning(
"Running non-meego graphics system enabled MeeGo touch, forcing native graphicssystem\n");
848 eventDispatcher->startingUp();
851 extern void qt_gui_eval_init(
uint);
852 qt_gui_eval_init(application_type);
855 #if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE) 859 #ifndef QT_NO_LIBRARY 860 if(load_testability) {
862 if (testLib.
load()) {
863 typedef void (*TasInitialize)(void);
864 TasInitialize initFunction = (TasInitialize)testLib.
resolve(
"qt_testability_init");
868 initFunction = (TasInitialize)testLib.
resolve(
"1");
874 qCritical(
"Library qttestability resolve failed!");
877 qCritical(
"Library qttestability load failed!");
887 symbianHandleLiteModeStartup();
891 #if defined(Q_WS_X11) 897 static char *
aargv[] = { (
char*)
"unknown", 0 };
915 qWarning(
"QApplication: Invalid Display* argument");
917 d->construct(dpy, visual, colormap);
924 qWarning(
"QApplication: Invalid Display* argument");
926 d->construct(dpy, visual, colormap);
949 qWarning(
"QApplication: Invalid Display* argument");
951 d->construct(dpy, visual, colormap);
959 qWarning(
"QApplication: Invalid Display* argument");
961 d->construct(dpy, visual, colormap);
971 #ifndef QT_NO_STATEMACHINE 989 #if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) 1001 #ifndef QT_NO_STATEMACHINE 1006 is_app_running =
true;
1009 #ifndef QT_NO_SESSIONMANAGER 1018 #ifdef QT_AUTO_MAXIMIZE_THRESHOLD 1025 #endif //QT_AUTO_MAXIMIZE_THRESHOLD 1033 #ifndef QT_NO_WHEELEVENT 1042 initializeMultitouch();
1076 return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->
isEmpty() ?
1077 QApplicationPrivate::popupWidgets->
last() : 0;
1097 return qt_modal_stack && !qt_modal_stack->
isEmpty() ? qt_modal_stack->
first() : 0;
1109 #ifndef QT_NO_CLIPBOARD 1121 d->toolTipWakeUp.stop();
1122 d->toolTipFallAsleep.stop();
1124 d->eventDispatcher->closingDown();
1125 d->eventDispatcher = 0;
1145 qt_desktopWidget = 0;
1147 #ifndef QT_NO_CLIPBOARD 1152 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 1153 delete d->move_cursor;
d->move_cursor = 0;
1154 delete d->copy_cursor;
d->copy_cursor = 0;
1155 delete d->link_cursor;
d->link_cursor = 0;
1157 #if defined(Q_WS_WIN) 1158 delete d->ignore_cursor;
d->ignore_cursor = 0;
1162 QApplicationPrivate::app_pal = 0;
1164 QApplicationPrivate::sys_pal = 0;
1166 QApplicationPrivate::set_pal = 0;
1167 app_palettes()->clear();
1172 QApplicationPrivate::app_font = 0;
1175 QApplicationPrivate::sys_font = 0;
1177 QApplicationPrivate::set_font = 0;
1178 app_fonts()->clear();
1181 QApplicationPrivate::app_style = 0;
1183 QApplicationPrivate::app_icon = 0;
1185 QApplicationPrivate::graphics_system = 0;
1186 #ifndef QT_NO_CURSOR 1187 d->cursor_list.clear();
1190 #ifndef QT_NO_DRAGANDDROP 1195 d->cleanupMultitouch();
1201 #ifndef QT_NO_SESSIONMANAGER 1202 delete d->session_manager;
1203 d->session_manager = 0;
1204 #endif //QT_NO_SESSIONMANAGER 1214 QApplicationPrivate::app_strut =
QSize(0, 0);
1223 #ifndef QT_NO_STATEMACHINE 1265 -
QRegion(wpoint.
x(), wpoint.
y(), 1, 1);
1302 ||
event->type() == QEvent::LayoutHint
1316 || cur.
event->
type() == QEvent::LayoutHint
1423 #ifndef QT_NO_STYLE_STYLESHEET 1432 QApplicationPrivate::styleSheet =
styleSheet;
1442 QApplicationPrivate::app_style->
setParent(newProxy);
1447 #endif // QT_NO_STYLE_STYLESHEET 1456 if (QApplicationPrivate::app_style)
1459 Q_ASSERT(!
"No style available in non-gui applications!");
1463 if (!QApplicationPrivate::app_style) {
1467 #ifdef QT_BUILD_INTERNAL 1472 if (!QApplicationPrivate::styleOverride.
isEmpty()) {
1474 }
else if (!envStyle.
isEmpty()) {
1484 for (
int i = 0; i < styles.
size(); ++i) {
1497 if (!QApplicationPrivate::sys_pal)
1499 if (QApplicationPrivate::set_pal)
1502 #ifndef QT_NO_STYLE_STYLESHEET 1503 if (!QApplicationPrivate::styleSheet.
isEmpty()) {
1504 qApp->setStyleSheet(QApplicationPrivate::styleSheet);
1507 QApplicationPrivate::app_style->
polish(
qApp);
1536 if (!style || style == QApplicationPrivate::app_style)
1542 if (QApplicationPrivate::app_style) {
1548 QApplicationPrivate::app_style->
unpolish(w);
1557 #ifndef QT_NO_STYLE_STYLESHEET 1558 if (!QApplicationPrivate::styleSheet.
isEmpty() && !qobject_cast<QStyleSheetStyle *>(style)) {
1562 QApplicationPrivate::app_style = newProxy;
1564 #endif // QT_NO_STYLE_STYLESHEET 1565 QApplicationPrivate::app_style =
style;
1571 if (QApplicationPrivate::set_pal) {
1573 }
else if (QApplicationPrivate::sys_pal) {
1576 }
else if (!QApplicationPrivate::sys_pal) {
1582 QApplicationPrivate::app_style->
polish(
qApp);
1590 QApplicationPrivate::app_style->polish(w);
1591 #ifndef QT_NO_STYLE_STYLESHEET 1612 #ifndef QT_NO_STYLE_STYLESHEET 1621 if (QApplicationPrivate::focus_widget) {
1624 QApplicationPrivate::focus_widget->
update();
1689 # ifdef QT_GRAPHICSSYSTEM_RUNTIME 1690 if (QApplicationPrivate::graphics_system_name ==
QLatin1String(
"runtime")) {
1696 QApplicationPrivate::graphics_system_name = system;
1769 qWarning(
"QApplication::setColorSpec: This function must be " 1770 "called before the QApplication object is created");
1799 QApplicationPrivate::app_strut = strut;
1809 if (!QApplicationPrivate::app_pal)
1829 if (w && hash && hash->
size()) {
1853 if (!QApplicationPrivate::app_pal)
1856 if (className && hash && hash->
size()) {
1868 if (QApplicationPrivate::app_style)
1869 QApplicationPrivate::app_style->
polish(pal);
1874 if (QApplicationPrivate::app_pal && pal.
isCopyOf(*QApplicationPrivate::app_pal))
1876 if (!QApplicationPrivate::app_pal)
1877 QApplicationPrivate::app_pal =
new QPalette(pal);
1879 *QApplicationPrivate::app_pal = pal;
1880 if (hash && hash->
size()) {
1882 if (clearWidgetPaletteHash)
1886 hash->
insert(className, pal);
1902 #ifndef QT_NO_GRAPHICSVIEW 1908 #endif //QT_NO_GRAPHICSVIEW 1910 if (!className && (!QApplicationPrivate::sys_pal || !palette.
isCopyOf(*QApplicationPrivate::sys_pal))) {
1911 if (!QApplicationPrivate::set_pal)
1912 QApplicationPrivate::set_pal =
new QPalette(palette);
1914 *QApplicationPrivate::set_pal =
palette;
1955 if (cmap.depths() > 4 && cmap.depths() < 24) {
1970 *sys_pal = adjusted;
1973 if (!QApplicationPrivate::set_pal)
1985 if (!QApplicationPrivate::app_font) {
1986 #if defined(Q_OS_BLACKBERRY) 2016 return hash->
value(
"QSmallFont");
2018 return hash->
value(
"QMiniFont");
2021 if (widget && hash && hash->
size()) {
2047 if (className && hash && hash->
size()) {
2081 if (!QApplicationPrivate::app_font)
2082 QApplicationPrivate::app_font =
new QFont(font);
2084 *QApplicationPrivate::app_font =
font;
2085 if (hash && hash->
size()) {
2090 hash->
insert(className, font);
2104 #ifndef QT_NO_GRAPHICSVIEW 2111 #endif //QT_NO_GRAPHICSVIEW 2113 if (!className && (!QApplicationPrivate::sys_font || !font.
isCopyOf(*QApplicationPrivate::sys_font))) {
2114 if (!QApplicationPrivate::set_font)
2115 QApplicationPrivate::set_font =
new QFont(font);
2117 *QApplicationPrivate::set_font =
font;
2126 sys_font =
new QFont(font);
2130 if (!QApplicationPrivate::set_font)
2157 if (!QApplicationPrivate::app_icon)
2158 QApplicationPrivate::app_icon =
new QIcon();
2159 *QApplicationPrivate::app_icon = icon;
2235 #ifndef QT_NO_GRAPHICSVIEW 2240 hidden_focus_widget = 0;
2242 if (focus != focus_widget) {
2244 hidden_focus_widget = focus;
2255 focus_widget = focus;
2272 focus_widget->d_func()->setFocus_sys();
2278 #ifdef QT_KEYPAD_NAVIGATION 2279 if (QApplication::keypadNavigationEnabled()) {
2285 prev->setEditFocus(
false);
2304 if(focus && QApplicationPrivate::focus_widget == focus) {
2319 emit qApp->focusChanged(prev, focus_widget);
2371 bool did_close =
true;
2376 did_close = w->
close();
2379 for (
int i = 0; did_close && i < list.
size(); ++i) {
2384 did_close = w->
close();
2402 #ifndef QT_NO_MESSAGEBOX 2410 #endif // QT_NO_MESSAGEBOX 2469 #ifndef QT_NO_TRANSLATION 2474 "Translate this string to the string 'LTR' in left-to-right" 2475 " languages or to 'RTL' in right-to-left languages (such as Hebrew" 2476 " and Arabic) to get proper widget layout.") ==
QLatin1String(
"RTL"));
2478 #if defined(Q_WS_MAC) 2492 if (translated != menuString)
2495 return qApp->translate(
"MAC_APPLICATION_MENU",
2508 #if defined(Q_OS_SYMBIAN) 2511 bool effectStarted = qt_beginFullScreenEffect();
2518 for (
int i = 0; i < list.
size(); ++i) {
2529 #if defined(Q_OS_SYMBIAN) 2531 qt_abortFullScreenEffect();
2535 #ifndef QT_NO_TRANSLATION 2538 #if defined(QT_MAC_USE_COCOA) 2542 for (
int i = 0; i < list.
size(); ++i) {
2552 for (
int i = 0; i < list.
size(); ++i) {
2556 w->d_func()->setLocale_helper(
QLocale(),
true);
2563 if (te->
timerId() ==
d->toolTipWakeUp.timerId()) {
2564 d->toolTipWakeUp.stop();
2565 if (
d->toolTipWidget) {
2566 QWidget *w =
d->toolTipWidget->window();
2571 while (w && !showToolTip) {
2580 d->toolTipFallAsleep.start(2000,
this);
2583 }
else if (te->
timerId() ==
d->toolTipFallAsleep.timerId()) {
2584 d->toolTipFallAsleep.stop();
2589 #if !defined(Q_WS_X11) 2626 if (QApplicationPrivate::active_window == window)
2629 #ifndef QT_NO_GRAPHICSVIEW 2639 if (QApplicationPrivate::active_window) {
2642 for (
int i = 0; i < list.
size(); ++i) {
2645 toBeDeactivated.
append(w);
2648 toBeDeactivated.
append(QApplicationPrivate::active_window);
2652 #if !defined(Q_WS_MAC) 2655 QApplicationPrivate::active_window =
window;
2657 if (QApplicationPrivate::active_window) {
2660 for (
int i = 0; i < list.
size(); ++i) {
2666 toBeActivated.
append(QApplicationPrivate::active_window);
2676 #if !defined(Q_WS_MAC) 2677 if (!previousActiveWindow) {
2683 for (
int i = 0; i < toBeActivated.
size(); ++i) {
2689 #ifdef QT_MAC_USE_COCOA 2693 qt_cocoaStackChildWindowOnTopOfOtherChildren(window);
2696 for(
int i = 0; i < toBeDeactivated.
size(); ++i) {
2702 #if !defined(Q_WS_MAC) 2703 if (!QApplicationPrivate::active_window) {
2709 if (QApplicationPrivate::popupWidgets == 0) {
2711 if (!QApplicationPrivate::active_window && QApplicationPrivate::focus_widget) {
2713 }
else if (QApplicationPrivate::active_window) {
2724 if (!w && QApplicationPrivate::active_window->focusPolicy() !=
Qt::NoFocus)
2726 else if (!QApplicationPrivate::active_window->isAncestorOf(w))
2748 QWidget *test = f->d_func()->focus_next;
2749 while (test && test != f) {
2750 if ((test->
focusPolicy() & focus_flag) == focus_flag
2751 && !(test->d_func()->extra && test->d_func()->extra->focus_proxy)
2759 test = test->d_func()->focus_next;
2792 if ((!enter && !leave) || (enter == leave))
2795 qDebug() <<
"QApplicationPrivate::dispatchEnterLeave, ENTER:" << enter <<
"LEAVE:" << leave;
2800 bool sameWindow = leave && enter && leave->
window() == enter->
window();
2801 if (leave && !sameWindow) {
2807 if (enter && !sameWindow) {
2824 while (enterDepth > leaveDepth) {
2828 while (leaveDepth > enterDepth) {
2832 while (!wenter->
isWindow() && wenter != wleave) {
2838 while (w != wleave) {
2843 while (w != wenter) {
2850 for (
int i = 0; i < leaveList.
size(); ++i) {
2851 w = leaveList.
at(i);
2853 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) 2854 if (leaveAfterRelease == w)
2855 leaveAfterRelease = 0;
2862 qApp->d_func()->notify_helper(w, &he);
2868 for (
int i = 0; i < enterList.
size(); ++i) {
2869 w = enterList.
at(i);
2875 qApp->d_func()->notify_helper(w, &he);
2880 #ifndef QT_NO_CURSOR 2884 #if defined(Q_WS_X11) || defined(Q_WS_QPA) 2887 QWidget *parentOfLeavingCursor = 0;
2888 for (
int i = 0; i < leaveList.
size(); ++i) {
2889 w = leaveList.
at(i);
2896 parentOfLeavingCursor =
parent;
2902 if (parentOfLeavingCursor && (!enterOnAlien
2904 #ifndef QT_NO_GRAPHICSVIEW 2908 #if defined(Q_WS_X11) 2910 #elif defined(Q_WS_QPA) 2921 QWidget *cursorWidget = enter;
2928 #ifndef QT_NO_GRAPHICSVIEW 2934 #if defined(Q_WS_WIN) 2936 #elif defined(Q_WS_X11) 2938 #elif defined(Q_OS_SYMBIAN) 2939 qt_symbian_set_cursor(cursorWidget,
true);
2940 #elif defined(Q_WS_QPA) 2962 widget = widget->
window();
2968 for (
int i = 0; i < qt_modal_stack->
size(); ++i) {
2969 QWidget *modalWidget = qt_modal_stack->
at(i);
2975 if (w == modalWidget)
3004 switch (windowModality) {
3009 groupLeaderForWidget = groupLeaderForWidget->
parentWidget();
3011 if (groupLeaderForWidget) {
3016 if (m == groupLeaderForWidget)
3018 }
else if (modalWidget != widget) {
3042 Q_ASSERT_X(
false,
"QApplication",
"internal error, a modal widget cannot be modeless");
3055 for (
int i = 0; i < windows.
count(); ++i) {
3061 enterModal_sys(widget);
3065 for (
int i = 0; i < windows.
count(); ++i) {
3078 for (
int i = 0; i < windows.
count(); ++i) {
3084 leaveModal_sys(widget);
3088 for (
int i = 0; i < windows.
count(); ++i) {
3112 #if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) 3118 return !isBlockedByModal(widget->
window());
3133 && !buttonDown && !mouseGrabber) {
3140 QWidget *receiver = candidate;
3143 mouseGrabber = (buttonDown && !isBlockedByModal(buttonDown)) ? buttonDown : alienWidget;
3145 if (mouseGrabber && mouseGrabber != candidate) {
3146 receiver = mouseGrabber;
3149 qDebug() <<
" ** receiver adjusted to:" << receiver <<
"pos:" << pos;
3170 if (alienWidget && !isAlien(alienWidget))
3181 if (!graphicsWidget) {
3185 leaveAfterRelease = *buttonDown;
3189 }
else if (lastMouseReceiver) {
3194 if ((alienWidget && alienWidget != lastMouseReceiver)
3195 || (isAlien(lastMouseReceiver) && !alienWidget)) {
3196 if (activePopupWidget) {
3198 dispatchEnterLeave(alienWidget ? alienWidget : nativeWidget, lastMouseReceiver);
3200 dispatchEnterLeave(receiver, lastMouseReceiver);
3207 qDebug() <<
"QApplicationPrivate::sendMouseEvent: receiver:" << receiver
3208 <<
"pos:" <<
event->
pos() <<
"alien" << alienWidget <<
"button down" 3209 << *buttonDown <<
"last" << lastMouseReceiver <<
"leave after release" 3210 << leaveAfterRelease;
3215 const bool wasLeaveAfterRelease = leaveAfterRelease != 0;
3229 enter = alienGuard ? alienWidget : nativeWidget;
3232 dispatchEnterLeave(enter, leaveAfterRelease);
3233 leaveAfterRelease = 0;
3234 lastMouseReceiver = enter;
3235 }
else if (!wasLeaveAfterRelease) {
3236 if (activePopupWidget) {
3238 lastMouseReceiver = alienGuard ? alienWidget : (nativeGuard ? nativeWidget : 0);
3247 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_QPA) 3258 #ifndef QT_NO_CURSOR 3259 #if defined(Q_WS_QWS) || defined(Q_WS_QPA) 3267 if (!widgetInShow && widget != qt_last_mouse_receiver)
3274 if (mouseGrabber && mouseGrabber != widget)
3281 if (widgetInShow && (!qt_last_mouse_receiver || qt_last_mouse_receiver->
window() != tlw))
3291 if (!widgetUnderCursor)
3292 widgetUnderCursor = tlw;
3294 pos = widgetUnderCursor->
mapFrom(tlw, pos);
3296 if (widgetInShow && widgetUnderCursor != widget && !widget->
isAncestorOf(widgetUnderCursor))
3304 sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver);
3305 #endif // QT_NO_CURSOR 3307 #endif // Q_WS_WIN || Q_WS_X11 || Q_WS_MAC 3322 if (!qt_desktopWidget ||
3329 #ifndef QT_NO_CLIPBOARD 3338 if (qt_clipboard == 0) {
3340 qWarning(
"QApplication: Must construct a QApplication before accessing a QClipboard");
3347 #endif // QT_NO_CLIPBOARD 3480 #ifndef QT_NO_SESSIONMANAGER 3484 return d->is_session_restored;
3490 return d->session_id;
3496 return d->session_key;
3591 #ifndef QT_NO_SESSIONMANAGER 3598 bool cancelled =
false;
3599 for (
int i = 0; !cancelled && i < list.
size(); ++i) {
3602 cancelled = !w->
close();
3672 #endif //QT_NO_SESSIONMANAGER 3812 for (
int i = 0; i < list.
size(); ++i) {
3837 Qt::Alignment QApplication::horizontalAlignment(Qt::Alignment align)
3854 #ifndef QT_NO_CURSOR 3857 return qApp->d_func()->cursor_list.isEmpty() ? 0 : &
qApp->d_func()->cursor_list.first();
3870 if (
qApp->d_func()->cursor_list.isEmpty())
3872 qApp->d_func()->cursor_list.removeFirst();
3918 #ifndef QT_NO_ACCESSIBILITY 3933 if (receiver == 0) {
3934 qWarning(
"QApplication::notify: Unexpected null receiver");
3939 d->checkReceiverThread(receiver);
3957 #if !defined(QT_NO_WHEELEVENT) || !defined(QT_NO_TABLETEVENT) 3962 # ifndef QT_NO_TABLETEVENT 3971 #endif // !QT_NO_WHEELEVENT || !QT_NO_TABLETEVENT 3974 #ifndef QT_NO_GESTURES 3976 if (
d->gestureManager) {
3977 switch (e->
type()) {
3985 case QEvent::ChildInsertedRequest:
3986 case QEvent::ChildInserted:
3987 case QEvent::LayoutHint:
4009 if (
d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
4015 if (
d->gestureManager->filterEvent(receiver, e))
4022 #endif // QT_NO_GESTURES 4025 switch (e->
type()) {
4035 d->toolTipFallAsleep.stop();
4038 d->toolTipWakeUp.stop();
4045 res =
d->notify_helper(receiver, e);
4046 }
else switch (e->
type()) {
4047 #if defined QT3_SUPPORT && !defined(QT_NO_SHORTCUT) 4050 if (
d->use_compat()) {
4052 res =
d->notify_helper(receiver, e);
4055 res =
d->qt_dispatchAccelEvent(static_cast<QWidget *>(receiver), key);
4059 if (!res && !key->
isAccepted() && !
static_cast<QWidget *
>(receiver)->isWindow())
4060 res =
d->notify_helper(static_cast<QWidget *>(receiver)->window(), e);
4064 #endif //QT3_SUPPORT && !QT_NO_SHORTCUT 4070 bool isGraphicsWidget =
false;
4071 #ifndef QT_NO_GRAPHICSVIEW 4074 if (!isWidget && !isGraphicsWidget) {
4075 res =
d->notify_helper(receiver, e);
4080 #if defined QT3_SUPPORT && !defined(QT_NO_SHORTCUT) 4081 if (
d->use_compat() &&
d->qt_tryComposeUnicode(static_cast<QWidget*>(receiver), key))
4085 #ifndef QT_NO_SHORTCUT 4087 if ((res =
qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key)))
4104 res =
d->notify_helper(receiver, e);
4106 #ifndef QT_NO_GRAPHICSVIEW 4125 #ifndef QT_NO_GRAPHICSVIEW 4126 || (isGraphicsWidget && (gw->isWindow() || !gw->parentWidget()))
4132 #ifndef QT_NO_GRAPHICSVIEW 4174 d->toolTipWidget = w;
4175 d->toolTipPos = relpos;
4177 d->toolTipWakeUp.start(
d->toolTipFallAsleep.isActive()?20:700,
this);
4192 for (
int i = 0; i <
d->eventFilters.size(); ++i) {
4193 register QObject *obj =
d->eventFilters.at(i);
4196 if (obj->d_func()->threadData != w->d_func()->threadData) {
4197 qWarning(
"QApplication: Object event filter cannot be in a different thread.");
4200 if (obj->
eventFilter(w, w == receiver ? mouse : &me))
4206 res =
d->notify_helper(w, w == receiver ? mouse : &me);
4209 eventAccepted = (w == receiver ? mouse : &me)->isAccepted();
4210 if (res && eventAccepted)
4224 w =
static_cast<QWidget *
>(receiver);
4225 relpos = mouse->
pos();
4231 d->notify_helper(w, &he);
4243 #ifndef QT_NO_WHEELEVENT 4261 res =
d->notify_helper(w, w == receiver ? wheel : &we);
4262 eventAccepted = ((w == receiver) ? wheel : &we)->isAccepted();
4264 if ((res && eventAccepted)
4275 #ifndef QT_NO_CONTEXTMENU 4285 res =
d->notify_helper(w, w == receiver ? context : &ce);
4286 eventAccepted = ((w == receiver) ? context : &ce)->isAccepted();
4289 if ((res && eventAccepted)
4299 #endif // QT_NO_CONTEXTMENU 4300 #ifndef QT_NO_TABLETEVENT 4316 res =
d->notify_helper(w, w == receiver ? tablet : &te);
4317 eventAccepted = ((w == receiver) ? tablet : &te)->isAccepted();
4319 if ((res && eventAccepted)
4331 #endif // QT_NO_TABLETEVENT 4333 #if !defined(QT_NO_TOOLTIP) || !defined(QT_NO_WHATSTHIS) 4345 res =
d->notify_helper(w, w == receiver ? help : &he);
4347 eventAccepted = (w == receiver ? help : &he)->isAccepted();
4348 if ((res && eventAccepted) || w->
isWindow())
4358 #if !defined(QT_NO_STATUSTIP) || !defined(QT_NO_WHATSTHIS) 4364 res =
d->notify_helper(w, e);
4373 #ifndef QT_NO_DRAGANDDROP 4381 if (currentTarget) {
4387 #ifndef QT_NO_GRAPHICSVIEW 4392 res =
d->notify_helper(w, dragEvent);
4398 res =
d->notify_helper(w, dragEvent);
4415 #ifndef QT_NO_GRAPHICSVIEW 4444 while (origReciver && w != origReciver) {
4449 res =
d->notify_helper(w, e);
4451 #ifndef QT_NO_GRAPHICSVIEW 4464 bool eventAccepted = touchEvent->
isAccepted();
4478 res = acceptTouchEvents &&
d->notify_helper(widget, touchEvent);
4486 touchEvent->spont =
false;
4487 if (res && eventAccepted) {
4491 d->widgetForTouchPointId[touchPoint.
id()] =
widget;
4524 res =
d->notify_helper(receiver, e);
4527 #ifndef QT_NO_GESTURES 4534 res =
d->notify_helper(w, e);
4549 bool eventAccepted = gestureEvent->
isAccepted();
4550 bool wasAccepted = eventAccepted;
4555 for (
int i = 0; i < allGestures.
size();) {
4572 ge.
t = gestureEvent->
t;
4573 ge.spont = gestureEvent->spont;
4574 ge.m_accept = wasAccepted;
4576 res =
d->notify_helper(w, &ge);
4577 gestureEvent->spont =
false;
4579 for (
int i = 0; i < gestures.
size(); ++i) {
4602 gestureEvent->m_accept =
false;
4604 res =
d->notify_helper(receiver, e);
4608 #endif // QT_NO_GESTURES 4609 #ifdef QT_MAC_USE_COCOA 4616 res =
d->notify_helper(receiver, e);
4624 res =
d->notify_helper(receiver, e);
4628 res =
d->notify_helper(receiver, e);
4638 if (sendThroughApplicationEventFilters(receiver, e))
4644 #if !defined(Q_WS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR)) 4659 if (sendThroughObjectEventFilters(receiver, e))
4663 bool consumed = receiver->
event(e);
5017 #ifndef QT_NO_SESSIONMANAGER 5018 #if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_QWS) 5020 #if defined(Q_OS_WINCE) 5025 wchar_t tempFilename[MAX_PATH];
5026 if (!GetModuleFileName(0, tempFilename, MAX_PATH))
5037 #if !defined(OLE32_MCOMGUID) || defined(QT_WINCE_FORCE_CREATE_GUID) 5038 #define CoCreateGuid qt_CoCreateGuid 5059 qt_session_manager_self =
this;
5060 #if defined(Q_WS_WIN) 5061 wchar_t guidstr[40];
5064 StringFromGUID2(guid, guidstr, 40);
5067 StringFromGUID2(guid, guidstr, 40);
5071 d->sessionKey =
key;
5077 qt_session_manager_self = 0;
5083 return d->sessionId;
5089 return d->sessionKey;
5093 #if defined(Q_WS_X11) || defined(Q_WS_MAC) 5100 #if !defined(Q_WS_WIN) 5123 d->restartHint = hint;
5129 return d->restartHint;
5135 d->restartCommand = command;
5141 return d->restartCommand;
5147 d->discardCommand = command;
5153 return d->discardCommand;
5174 #endif // QT_NO_SESSIONMANAGER 5298 QWidget *QApplication::mainWidget()
5305 return QApplicationPrivate::popupWidgets != 0;
5340 if (
qApp &&
qApp->d_func()->in_exec) {
5368 #ifdef QT_KEYPAD_NAVIGATION 5392 QApplicationPrivate::setNavigationMode(mode);
5394 QApplicationPrivate::navigationMode = mode;
5417 return QApplicationPrivate::navigationMode;
5435 void QApplication::setKeypadNavigationEnabled(
bool enable)
5464 bool QApplication::keypadNavigationEnabled()
5703 if (inputContext == QApplicationPrivate::inputContext)
5705 if (!inputContext) {
5706 qWarning(
"QApplication::setInputContext: called with 0 input context");
5710 QApplicationPrivate::inputContext = inputContext;
5711 QApplicationPrivate::inputContext->
setParent(
this);
5724 return d->inputContext;
5728 if (!
d->inputContext) {
5736 #elif defined(Q_OS_SYMBIAN) 5737 if (!
d->inputContext) {
5744 if (!that->d_func()->inputContextBeingCreated) {
5745 that->d_func()->inputContextBeingCreated =
true;
5747 that->d_func()->inputContextBeingCreated =
false;
5750 for (
int c = 0;
c < keys.
size() && !
d->inputContext; ++
c) {
5756 return d->inputContext;
5762 uint platform = KB_Win;
5765 #elif defined Q_WS_X11 5770 platform |= KB_Gnome;
5773 #elif defined(Q_OS_SYMBIAN) 5820 while (focusWidget) {
5823 focusWidget->
setFocus(focusReason);
5835 while (f->d_func()->extra && f->d_func()->extra->focus_proxy)
5836 f = f->d_func()->extra->focus_proxy;
5840 if (w != f && (f->
focusPolicy() & policy) != policy)
5993 touchPoint.
d->
rect = rect;
6003 widgetForTouchPointId.clear();
6004 appCurrentTouchPoints.clear();
6006 initializeMultitouch_sys();
6011 cleanupMultitouch_sys();
6013 widgetForTouchPointId.clear();
6014 appCurrentTouchPoints.clear();
6019 int closestTouchPointId = -1;
6023 if (closestTouchPointId == -1 || distance < closestDistance) {
6024 closestTouchPointId = touchPoint.
id();
6028 return closestTouchPointId;
6039 for (
int i = 0; i < touchPoints.
count(); ++i) {
6044 touchPoint.
d = touchPoint.
d->
detach();
6048 switch (touchPoint.
state()) {
6074 widget = closestWidget;
6131 StatesAndTouchPoints &maskAndPoints = widgetsNeedingEvents[widget.
data()];
6132 maskAndPoints.first |= touchPoint.
state();
6135 maskAndPoints.second.append(touchPoint);
6138 if (widgetsNeedingEvents.
isEmpty())
6143 for (; it !=
end; ++
it) {
6169 updateTouchPointsForWidget(widget, &
touchEvent);
6198 #ifndef QT_NO_GESTURES 6208 #endif // QT_NO_GESTURES 6217 #if defined(Q_WS_WIN) 6252 "aa......................",
6253 "aXa.....................",
6254 "aXXa....................",
6255 "aXXXa...................",
6256 "aXXXXa..................",
6257 "aXXXXXa.................",
6258 "aXXXXXXa................",
6259 "aXXXXXXXa...............",
6260 "aXXXXXXXXa..............",
6261 "aXXXXXXXXXa.............",
6262 "aXXXXXXaaaa.............",
6263 "aXXXaXXa................",
6264 "aXXaaXXa................",
6265 "aXa..aXXa...............",
6266 "aa...aXXa...............",
6267 "a.....aXXa..............",
6268 "......aXXa.....XXXX.....",
6269 ".......aXXa..XXaaaaXX...",
6270 ".......aXXa.XaaaaaaaaX..",
6271 "........aa.XaaaXXXXaaaX.",
6272 "...........XaaaaX..XaaX.",
6273 "..........XaaXaaaX..XaaX",
6274 "..........XaaXXaaaX.XaaX",
6275 "..........XaaX.XaaaXXaaX",
6276 "..........XaaX..XaaaXaaX",
6277 "...........XaaX..XaaaaX.",
6278 "...........XaaaXXXXaaaX.",
6279 "............XaaaaaaaaX..",
6280 ".............XXaaaaXX...",
6281 "...............XXXX....."};
6290 #if defined(Q_WS_WIN) // Windows cursor is traditionally white 6291 "aa......................",
6292 "aXa.....................",
6293 "aXXa....................",
6294 "aXXXa...................",
6295 "aXXXXa..................",
6296 "aXXXXXa.................",
6297 "aXXXXXXa................",
6298 "aXXXXXXXa...............",
6299 "aXXXXXXXXa..............",
6300 "aXXXXXXXXXa.............",
6301 "aXXXXXXaaaa.............",
6302 "aXXXaXXa................",
6303 "aXXaaXXa................",
6304 "aXa..aXXa...............",
6305 "aa...aXXa...............",
6306 "a.....aXXa..............",
6307 "......aXXa..............",
6308 ".......aXXa.............",
6309 ".......aXXa.............",
6310 "........aa...aaaaaaaaaaa",
6312 "XX......................",
6313 "XaX.....................",
6314 "XaaX....................",
6315 "XaaaX...................",
6316 "XaaaaX..................",
6317 "XaaaaaX.................",
6318 "XaaaaaaX................",
6319 "XaaaaaaaX...............",
6320 "XaaaaaaaaX..............",
6321 "XaaaaaaaaaX.............",
6322 "XaaaaaaXXXX.............",
6323 "XaaaXaaX................",
6324 "XaaXXaaX................",
6325 "XaX..XaaX...............",
6326 "XX...XaaX...............",
6327 "X.....XaaX..............",
6328 "......XaaX..............",
6329 ".......XaaX.............",
6330 ".......XaaX.............",
6331 "........XX...aaaaaaaaaaa",
6333 ".............aXXXXXXXXXa",
6334 ".............aXXXXXXXXXa",
6335 ".............aXXXXaXXXXa",
6336 ".............aXXXXaXXXXa",
6337 ".............aXXaaaaaXXa",
6338 ".............aXXXXaXXXXa",
6339 ".............aXXXXaXXXXa",
6340 ".............aXXXXXXXXXa",
6341 ".............aXXXXXXXXXa",
6342 ".............aaaaaaaaaaa"};
6350 #if defined(Q_WS_WIN) // Windows cursor is traditionally white 6351 "aa......................",
6352 "aXa.....................",
6353 "aXXa....................",
6354 "aXXXa...................",
6355 "aXXXXa..................",
6356 "aXXXXXa.................",
6357 "aXXXXXXa................",
6358 "aXXXXXXXa...............",
6359 "aXXXXXXXXa..............",
6360 "aXXXXXXXXXa.............",
6361 "aXXXXXXaaaa.............",
6362 "aXXXaXXa................",
6363 "aXXaaXXa................",
6364 "aXa..aXXa...............",
6365 "aa...aXXa...............",
6366 "a.....aXXa..............",
6367 "......aXXa..............",
6368 ".......aXXa.............",
6369 ".......aXXa.............",
6370 "........aa...aaaaaaaaaaa",
6372 "XX......................",
6373 "XaX.....................",
6374 "XaaX....................",
6375 "XaaaX...................",
6376 "XaaaaX..................",
6377 "XaaaaaX.................",
6378 "XaaaaaaX................",
6379 "XaaaaaaaX...............",
6380 "XaaaaaaaaX..............",
6381 "XaaaaaaaaaX.............",
6382 "XaaaaaaXXXX.............",
6383 "XaaaXaaX................",
6384 "XaaXXaaX................",
6385 "XaX..XaaX...............",
6386 "XX...XaaX...............",
6387 "X.....XaaX..............",
6388 "......XaaX..............",
6389 ".......XaaX.............",
6390 ".......XaaX.............",
6391 "........XX...aaaaaaaaaaa",
6393 ".............aXXXXXXXXXa",
6394 ".............aXXXaaaaXXa",
6395 ".............aXXXXaaaXXa",
6396 ".............aXXXaaaaXXa",
6397 ".............aXXaaaXaXXa",
6398 ".............aXXaaXXXXXa",
6399 ".............aXXaXXXXXXa",
6400 ".............aXXXaXXXXXa",
6401 ".............aXXXXXXXXXa",
6402 ".............aaaaaaaaaaa"};
6406 #if defined(Q_WS_X11) || defined(Q_WS_WIN) 6418 return *move_cursor;
6420 return *copy_cursor;
6422 return *link_cursor;
6425 return *ignore_cursor;
6438 #include "moc_qapplication.cpp" QSet< QWidget * > QWidgetSet
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
static QPointer< QWidget > leaveAfterRelease
static void aboutQt(QWidget *parent, const QString &title=QString())
Displays a simple message box about Qt, with the given title and centered over parent (if parent is n...
The QColor class provides colors based on RGB, HSV or CMYK values.
void setPointSize(int)
Sets the point size to pointSize.
static QT_DEPRECATED int argc()
Use arguments().
static uint hash(const uchar *p, int n)
virtual void unpolish(QWidget *)
Uninitialize the given {widget}'s appearance.
void setAccepted(QGesture *, bool)
Sets the accept flag of the given gesture object to the specified value.
static QWidget * main_widget
static Qt::LayoutDirection layoutDirection()
uint qHash(const QProcEnvKey &key)
bool allowsErrorInteraction()
Returns true if error interaction is permitted; otherwise returns false.
QApplicationPrivate(int &argc, char **argv, QApplication::Type type, int flags)
static QApplicationPrivate * self
int id() const
Returns the id number of this touch point.
static QWidgetList allWidgets()
Returns a list of all the widgets in the application.
The QApplication class manages the GUI application's control flow and main settings.
void qt_mac_post_retranslateAppMenu()
static QColormap instance(int screen=-1)
static bool qt_detectRTLLanguage()
static QInputContext * create(const QString &key, QObject *parent)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QKeyEvent class describes a key event.
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
int qUnregisterGuiVariant()
static bool checkInstance(const char *method)
static void setPalette(const QPalette &, const char *className=0)
Changes the default application palette to palette.
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
static bool is_app_running
void initialize()
Initializes the QApplication object, called from the constructors.
static int exec()
Enters the main event loop and waits until exit() is called, then returns the value that was set to e...
The QCursor class provides a mouse cursor with an arbitrary shape.
static mach_timebase_info_data_t info
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
The QMutex class provides access serialization between threads.
void construct(Display *dpy=0, Qt::HANDLE visual=0, Qt::HANDLE cmap=0)
QPointer< QWidget > widget
static const char *const ignore_xpm[]
void clear()
Removes all items from the hash.
Qt::TouchPointState state() const
Returns the current state of this touch point.
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
static void setStyle(QStyle *)
Sets the application's GUI style to style.
static QWidget * pickMouseReceiver(QWidget *candidate, const QPoint &globalPos, QPoint &pos, QEvent::Type type, Qt::MouseButtons buttons, QWidget *buttonDown, QWidget *alienWidget)
bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
QString sessionKey() const
Returns the session key in the current Session Management{session}.
virtual void commitData(QSessionManager &sm)
This function deals with Session Management{session management}.
#define it(className, varName)
Qt::DropActions possibleActions() const
Returns an OR-combination of possible drop actions.
int xTilt() const
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of t...
QList< QWidget * > QWidgetList
The QWheelEvent class contains parameters that describe a wheel event.
static void updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent)
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
static QPalette * set_pal
QDateTime created() const
Returns the date and time when the file was created.
static void initializeWidgetPaletteHash()
bool notify(QObject *, QEvent *)
Reimplemented Function
QRectF rect() const
Returns the rect for this touch point, relative to the widget or QGraphicsItem that received the even...
static QSize globalStrut()
const_iterator constEnd() const
The QByteArray class provides an array of bytes.
static bool force_reverse
The QHoverEvent class contains parameters that describe a mouse event.
static QWidget * activeWindow()
Returns the application top-level window that has the keyboard input focus, or 0 if no application wi...
QSessionManager::RestartHint restartHint
static int colorSpec()
Returns the color specification.
void setAccepted(bool accepted)
QMap< int, QTouchEvent::TouchPoint > appCurrentTouchPoints
The QPointF class defines a point in the plane using floating point precision.
static Qt::MouseButtons buttons
static void setStartDragDistance(int l)
QPointF startNormalizedPos
QPointF lastScreenPos() const
Returns the screen position of this touch point from the previous touch event.
static int exec()
Enters the main event loop and waits until exit() is called.
void setGraphicsSystem(const QString &name)
static QStyle * create(const QString &)
static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOptionComplex &opt, QStyle::ComplexControl complexControl, QStyle::SubControl subControl)
static int wheel_scroll_lines
uint toTime_t() const
Returns the datetime as the number of seconds that have passed since 1970-01-01T00:00:00, Coordinated Universal Time (Qt::UTC).
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
void qInitDrawhelperAsm()
bool qt_wince_is_mobile()
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
QStringList restartCommand
#define QT_TRANSLATE_NOOP(scope, x)
Marks the string literal sourceText for dynamic translation in the given context; i...
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
static QWidget * active_window
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const QPointF & hiResGlobalPos() const
The high precision coordinates delivered from the tablet expressed.
static QApplicationPrivate * instance()
int count(const T &t) const
Returns the number of occurrences of value in the list.
static QPalette palette()
Returns the application palette.
static QStyle * style()
Returns the application's style object.
static QLocale keyboardInputLocale()
Returns the current keyboard input locale.
iterator find(const Key &key)
Returns an iterator pointing to the item with key key in the map.
QLocale keyboardInputLocale
static void setWindowIcon(const QIcon &icon)
void * resolve(const char *symbol)
Returns the address of the exported symbol symbol.
void saveStateRequest(QSessionManager &sessionManager)
This signal deals with Session Management{session management}.
QStringList restartCommand() const
Returns the currently set restart command.
bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event)
The QString class provides a Unicode character string.
T * qobject_cast(QObject *object)
QClipboard * qt_clipboard
The QHash class is a template class that provides a hash-table-based dictionary.
bool isNull() const
Returns true if this object is holding a reference to a null pointer.
static QT_DEPRECATED char ** argv()
Use arguments() instead.
DeviceType
This enum represents the type of device that generated a QTouchEvent.
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *)
Returns true if event was compressed away (possibly deleted) and should not be added to the list...
bool isCopyOf(const QFont &) const
Returns true if this font and f are copies of each other, i.e.
The QObject class is the base class of all Qt objects.
QInputContext * inputContext() const
Returns the QInputContext instance used by the application.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
const QPoint & pos() const
Returns the position of the device, relative to the widget that received the event.
static const char *const copy_xpm[]
bool qt_wince_is_smartphone()
Qt::KeyboardModifiers keyboardModifiers() const
Returns the modifier keys that are pressed.
QPointer< QWidget > qt_last_mouse_receiver
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
QPointF normalizedPos() const
Returns the normalized position of this touch point.
static QPalette * app_pal
int qRegisterGuiStateMachine()
void setDiscardCommand(const QStringList &)
Sets the discard command to the given list.
static QGestureManager * instance()
const T value(const Key &key) const
Returns the value associated with the key.
QWidgetList * qt_modal_stack
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
bool allowsInteraction()
Asks the session manager for permission to interact with the user.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
void setParent(QObject *)
Makes the object a child of parent.
static bool autoSipEnabled
PointerType pointerType() const
Returns the type of point that generated the event.
static QWidget * focus_widget
void setObjectName(const QString &name)
QApplication(int &argc, char **argv)
Initializes the window system and constructs an application object with argc command line arguments i...
int qt_antialiasing_threshold
static QFont font()
Returns the default application font.
The QLineF class provides a two-dimensional vector using floating point precision.
Q_CORE_EXPORT void qt_call_post_routines()
static void changeOverrideCursor(const QCursor &)
Changes the currently active application override cursor to cursor.
static uint currentPlatform()
int qRegisterGuiVariant()
const Key & key() const
Returns the current item's key.
void release()
Releases the session manager's interaction semaphore after an interaction phase.
static int keyboard_input_time
Q_CORE_EXPORT void qDebug(const char *,...)
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or 0 if there is no Qt widget there...
static QFontMetrics fontMetrics()
Returns display (screen) font metrics for the application font.
qreal pressure() const
Returns the pressure of this touch point.
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
QByteArray right(int len) const
Returns a byte array that contains the rightmost len bytes of this byte array.
int key() const
Returns the code of the key that was pressed or released.
static void setLayoutDirection(Qt::LayoutDirection direction)
friend class const_iterator
void commitDataRequest(QSessionManager &sessionManager)
This signal deals with Session Management{session management}.
void setRestartCommand(const QStringList &)
If the session manager is capable of restoring sessions it will execute command in order to restore t...
static QIcon windowIcon()
static QWidget * activeModalWidget()
Returns the active modal widget.
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
void setCursor(const QCursor &cursor)
Sets the current cursor shape for the item to cursor.
void append(const T &t)
Inserts value at the end of the list.
static void giveFocusAccordingToFocusPolicy(QWidget *w, Qt::FocusPolicy focusPolicy, Qt::FocusReason focusReason)
void setRestartHint(RestartHint)
Sets the application's restart hint to hint.
static void setSystemFont(const QFont &font)
The QSessionManager class provides access to the session manager.
QDesktopWidget * qt_desktopWidget
static QCursor * overrideCursor()
Strips out vertical alignment flags and transforms an alignment align of Qt::AlignLeft into Qt::Align...
static void setStartDragTime(int ms)
bool autoSipEnabled() const
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool load_testability
#define Q_INIT_RESOURCE(name)
QList< QTouchEvent::TouchPoint > _touchPoints
The QGestureEvent class provides the description of triggered gestures.
The QMoveEvent class contains event parameters for move events.
The QRectF class defines a rectangle in the plane using floating point precision. ...
static QGraphicsSystem * create(const QString &)
bool isCopyOf(const QPalette &p) const
Returns true if this palette and p are copies of each other, i.e.
Q_GUI_EXPORT EGLDisplay display()
static QStringList keys()
Returns the list of valid keys, i.e.
QSessionManager(QApplication *app, QString &id, QString &key)
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
static bool isEmpty(const char *str)
#define QT_GUI_DRAG_DISTANCE
const QColor colorAt(uint pixel) const
QString qt_mac_applicationmenu_string(int type)
em>Reimplemented Function
void setStyleSheet(const QString &sheet)
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
qint64 uniqueId() const
Returns a unique ID for the current device, making it possible to differentiate between multiple devi...
static void setFocusWidget(QWidget *focus, Qt::FocusReason reason)
static QClipboard * clipboard()
Returns a pointer to the application global clipboard.
bool contains(const T &value) const
QList< T > toList() const
QPointF lastPos() const
Returns the position of this touch point from the previous touch event, relative to the widget or QGr...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static Qt::LayoutDirection layout_direction
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
QCoreApplication(int &argc, char **argv)
Constructs a Qt kernel application.
The QLayout class is the base class of geometry managers.
static QWidgetList * popupWidgets
const T value(const Key &key) const
Returns the value associated with the key key.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
void prepend(const T &t)
Inserts value at the beginning of the list.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
bool spontaneous() const
Returns true if the event originated outside the application (a system event); otherwise returns fals...
static int toInt(const QByteArray &str)
static bool quitOnLastWindowClosed
static int startDragTime()
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)
static int mouse_double_click_time
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
The QResizeEvent class contains event parameters for resize events.
const char * styleHint(const QFontDef &request)
const T & value() const
Returns the current item's value.
static QWidget * hidden_focus_widget
bool notify_helper(QObject *receiver, QEvent *e)
Q_CORE_EXPORT void qWarning(const char *,...)
const_iterator ConstIterator
int delta() const
Returns the distance that the wheel is rotated, in eighths of a degree.
const_iterator insert(const T &value)
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
static const char * data(const QByteArray &arr)
Qt::MouseButtons buttons() const
Returns the mouse state when the event occurred.
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QMap< Qt::GestureType, QWidget * > targetWidgets
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
const_iterator constFind(const Key &key) const
Returns an iterator pointing to the item with the key in the hash.
#define Q_INIT_RESOURCE_EXTERN(name)
FontHash * qt_app_fonts_hash()
static bool animate_combo
void qt_mac_set_app_icon(const QPixmap &pixmap)
static void setPalette_helper(const QPalette &palette, const char *className, bool clearWidgetPaletteHash)
static QStyle * app_style
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
QPointF screenPos() const
Returns the screen position of this touch point.
QPointF startNormalizedPos() const
Returns the normalized starting position of this touch point.
QList< QGesture * > gestures() const
Returns all gestures that are delivered in the event.
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
The QRegion class specifies a clip region for a painter.
static QPalette * sys_pal
QPointF startScreenPos() const
Returns the starting screen position of this touch point.
void sendSyntheticEnterLeave(QWidget *widget)
The QClipboard class provides access to the window system clipboard.
void setInputContext(QInputContext *)
This function replaces the QInputContext instance used by the application with inputContext.
static int startDragDistance()
Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window, QTouchEvent::DeviceType deviceType, const QList< QTouchEvent::TouchPoint > &touchPoints)
static int app_compile_version
bool isPhase2() const
Returns true if the session manager is currently performing a second session management phase; otherw...
static QStringList keys()
Returns the list of keys this factory can create input contexts for.
virtual void saveState(QSessionManager &sm)
This function deals with Session Management{session management}.
QTouchEventTouchPointPrivate * detach()
QString sessionId() const
Returns the current Session Management{session's} identifier.
static void setGraphicsSystem(const QString &)
Sets the default graphics backend to system, which will be used for on-screen widgets and QPixmaps...
static bool runtime_graphics_system
static void setActiveWindow(QWidget *act)
Sets the active window to the active widget in response to a system event.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
static const char *const move_xpm[]
Qt::Orientation orientation() const
Returns the wheel's orientation.
int indexOf(char c, int from=0) const
Returns the index position of the first occurrence of the character ch in the byte array...
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
Qt::MouseButton button() const
Returns the button that caused the event.
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
static QString graphics_system_name
static QWidget * topLevelAt(const QPoint &p)
Returns the top-level widget at the given point; returns 0 if there is no such widget.
static int qt_matchLibraryName(dl_phdr_info *info, size_t, void *data)
uint pixel(const QColor &color) const
bool Q_GUI_EXPORT qt_tab_all_widgets
int findClosestTouchPointId(const QPointF &screenPos)
The QTabletEvent class contains parameters that describe a Tablet event.
void setManagerProperty(const QString &name, const QString &value)
Low-level write access to the application's identification and state records are kept in the session ...
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
QStringList discardCommand() const
Returns the currently set discard command.
The QMouseEvent class contains parameters that describe a mouse event.
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
int length() const
Same as size().
QHash< WId, QWidget * > QWidgetMapper
RestartHint
This enum type defines the circumstances under which this application wants to be restarted by the se...
static QDragManager * self()
const QPoint & pos() const
Returns the position of the mouse cursor relative to the widget that received the event...
T & first()
Returns a reference to the first item in the list.
bool qt_wince_is_pocket_pc()
static bool animate_tooltip
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
static void setColorSpec(int)
Sets the color specification for the application to spec.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
QPointF lastNormalizedPos
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
qreal pressure() const
Returns the pressure for the device.
static bool tryModalHelper(QWidget *widget, QWidget **rettop=0)
static const char *const link_xpm[]
QString sessionId() const
Returns the identifier of the current session.
static QWidget * focusNextPrevChild_helper(QWidget *toplevel, bool next)
internal Helper function that returns the new focus widget, but does not set the focus reason...
The QCoreApplication class provides an event loop for console Qt applications.
#define Q_ASSERT_X(cond, where, what)
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
Qt::MouseButtons mouseButtons() const
Returns the mouse buttons that are pressed.
void setCurrentTarget(QWidget *target, bool dropped=false)
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLe...
static QLocale c()
Returns a QLocale object initialized to the "C" locale.
void qt_init(QApplicationPrivate *priv, int type, Display *display=0, Qt::HANDLE visual=0, Qt::HANDLE colormap=0)
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
static bool obey_desktop_settings
virtual ~QApplication()
Cleans up any window system resources that were allocated by this application.
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
static QWidget * activePopupWidget()
Returns the active popup widget.
int z() const
Returns the z position of the device.
void setAutoMaximizeThreshold(const int threshold)
static const char * application_menu_strings[]
QString & append(QChar c)
bool load()
Loads the library and returns true if the library was loaded successfully; otherwise returns false...
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
int size() const
Returns the number of items in the hash.
int autoMaximizeThreshold() const
void setAutoSipEnabled(const bool enabled)
void qt_win_set_cursor(QWidget *, bool)
static Qt::KeyboardModifiers modifier_buttons
static void setRootObject(QObject *)
Sets the root accessible object of this application to object.
static void aboutQt()
Displays a simple message box about Qt.
int qUnregisterGuiStateMachine()
friend class QApplicationPrivate
Type
This enum type defines the valid event types in Qt.
The QTimerEvent class contains parameters that describe a timer event.
static bool isBlockedByModal(QWidget *widget)
Returns true if widget is blocked by a modal window.
static QWidget * tryModalHelper_sys(QWidget *top)
static QInputContext * inputContext
The QFont class specifies a font used for drawing text.
The QGesture class represents a gesture, containing properties that describe the corresponding user i...
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
static void closeAllWindows()
Closes all top-level windows.
static void setQuitOnLastWindowClosed(bool quit)
QPixmap getPixmapCursor(Qt::CursorShape cshape)
Qt::GestureType gestureType
the type of the gesture
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
QWidget * currentTarget()
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
QString sessionKey() const
Returns the session key in the current session.
QGestureEventPrivate * d_func()
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
bool isSessionRestored() const
Returns true if the application has been restored from an earlier Session Management{session}; otherw...
static void syncX()
Synchronizes with the X server in the X11 implementation.
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
QPointF pos() const
Returns the position of this touch point, relative to the widget or QGraphicsItem that received the e...
static QString styleSheet
const QPoint & globalPos() const
Returns the global position of the device at the time of the event.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
static bool animate_toolbox
QObject * parent() const
Returns a pointer to the parent object.
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
static QString desktopStyleKey()
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
T & last()
Returns a reference to the last item in the list.
const QList< QTouchEvent::TouchPoint > & touchPoints() const
Returns the list of touch points contained in the touch event.
int yTilt() const
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of t...
int size() const
Returns the number of items in the list.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
RestartHint restartHint() const
Returns the application's current restart hint.
bool isEmpty() const
Returns true if the map contains no items; otherwise returns false.
static bool desktopSettingsAware()
Returns true if Qt is set to use the system's standard colors, fonts, etc.
qreal tangentialPressure() const
Returns the tangential pressure for the device.
QApplication::Type qt_appType
const QPoint & globalPos() const
Returns the mouse cursor position when the event was generated in global coordinates.
QTouchEventTouchPointPrivate * d
QMap< int, QWeakPointer< QWidget > > widgetForTouchPointId
static QGraphicsSystem * graphics_system
static QDateTime currentDateTime()
Returns the current datetime, as reported by the system clock, in the local time zone.
virtual void reset()=0
This function can be reimplemented in a subclass to reset the state of the input method.
const_iterator constBegin() const
bool contains(const Key &key) const
Returns true if the map contains an item with key key; otherwise returns false.
const QPoint & globalPos() const
Returns the global position of the mouse pointer at the time of the event.
bool compressEvent(QEvent *, QObject *receiver, QPostEventList *)
static void dispatchEnterLeave(QWidget *enter, QWidget *leave)
static void setSystemPalette(const QPalette &pal)
int y() const
Returns the y coordinate of this point.
static bool is_app_closing
void initializeMultitouch()
bool isPrimary() const
Returns true if this touch point is the primary touch point.
The QPixmap class is an off-screen image representation that can be used as a paint device...
static QString styleOverride
QMap< WId, QDirectPainter * > * directPainters
The TouchPoint class provides information about a touch point in a QTouchEvent.
virtual void polish(QWidget *)
Initializes the appearance of the given widget.
static void setOverrideCursor(const QCursor &)
Use changeOverrideCursor(cursor) (if replace is true) or setOverrideCursor(cursor) (if replace is fal...
static void emitLastWindowClosed()
bool isAccepted(QGesture *) const
Returns true if the gesture is accepted; otherwise returns false.
void qInitImageConversions()
QKeyMapperPrivate * qt_keymapper_private()
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Qt::GestureState state
the current state of the gesture
The QTouchEvent class contains parameters that describe a touch event.
T take(const Key &key)
Removes the item with the key key from the map and returns the value associated with it...
QRectF screenRect() const
Returns the rect for this touch point in screen coordinates.
const QMimeData * mimeData() const
Returns the data that was dropped on the widget and its associated MIME type information.
The QSize class defines the size of a two-dimensional object using integer point precision.
void setWidget(QWidget *awidget)
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
int qstrcmp(const QByteArray &str1, const char *str2)
int x() const
Returns the x coordinate of this point.
qreal rotation() const
Returns the rotation of the current device in degress.
QTouchEventSequence touchEvent(QWidget *widget=0, QTouchEvent::DeviceType deviceType=QTouchEvent::TouchScreen)
Creates and returns a QTouchEventSequence for the device deviceType to simulate events for widget...
static bool shouldSetFocus(QWidget *w, Qt::FocusPolicy policy)
The QInputContext class abstracts the input method dependent data and composing state.
HRESULT qt_CoCreateGuid(GUID *guid)
static void translateRawTouchEvent(QWidget *widget, QTouchEvent::DeviceType deviceType, const QList< QTouchEvent::TouchPoint > &touchPoints)
static bool quitOnLastWindowClosed()
static Qt::LayoutDirection keyboardInputDirection()
Returns the current keyboard input direction.
static bool isAlien(QWidget *)
The QFileInfo class provides system-independent file information.
static void setFont(const QFont &, const char *className=0)
Changes the default application font to font.
static const KeyPair *const end
void requestPhase2()
Requests a second session management phase for the application.
PaletteHash * qt_app_palettes_hash()
virtual void setFocusWidget(QWidget *w)
Sets the widget that has an input focus for this input context.
QGestureManager * gestureManager
void moveCenter(const QPointF &p)
Moves the rectangle, leaving the center point at the given position.
static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget, QWidget *native, QWidget **buttonDown, QPointer< QWidget > &lastMouseReceiver, bool spontaneous=true)
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
QMap< Qt::GestureType, bool > accepted
Qt::LayoutDirection keyboardInputDirection
const QPoint & globalPos() const
Returns the global position of the mouse cursor at the time of the event.
QPointF center() const
Returns the center point of the rectangle.
static int autoMaximizeThreshold
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
static void leaveModal(QWidget *)
QStringList discardCommand
static void initResources()
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void repolish(QWidget *widget)
void cancel()
Tells the session manager to cancel the shutdown process.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Q_GUI_EXPORT bool qt_tryModalHelper(QWidget *widget, QWidget **rettop)
The QCloseEvent class contains parameters that describe a close event.
static void setDesktopSettingsAware(bool)
Sets whether Qt should use the system's standard colors, fonts, etc., to on.
The QFocusEvent class contains event parameters for widget focus events.
static void setGlobalStrut(const QSize &)
static void enterModal(QWidget *)
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
TabletDevice device() const
Returns the type of device that generated the event.
The QMap class is a template class that provides a skip-list-based dictionary.
static Qt::MouseButtons mouse_buttons
Q_CORE_EXPORT void qCritical(const char *,...)
const QPoint & pos() const
Returns the position where the drop was made.
virtual bool filterEvent(const QEvent *event)
This function can be reimplemented in a subclass to filter input events.
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
QPointF startPos() const
Returns the starting position of this touch point, relative to the widget or QGraphicsItem that recei...
QSessionManager * qt_session_manager_self
The QLibrary class loads shared libraries at runtime.
The QList class is a template class that provides lists.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
static int cursor_flash_time
Qt::LayoutDirection direction
QString styleSheet() const
The QHelpEvent class provides an event that is used to request helpful information about a particular...
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.
void removeAt(int i)
Removes the item at index position i.
const QPoint & pos() const
Returns the mouse cursor position when the event was generated, relative to the widget to which the e...