Qt 4.8
Public Types | Public Functions | Static Public Functions | Public Variables | Static Public Variables | Static Private Functions | Properties | Static Private Attributes | List of all members
QApplicationPrivate Class Reference

#include <qapplication_p.h>

Inheritance diagram for QApplicationPrivate:
QCoreApplicationPrivate QObjectPrivate QObjectData

Public Types

enum  KeyPlatform {
  KB_Win = 1, KB_Mac = 2, KB_X11 = 4, KB_KDE = 8,
  KB_Gnome = 16, KB_CDE = 32, KB_S60 = 64, KB_All = 0xffff
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 

Public Functions

void _q_alertTimeOut ()
 
void appendTouchPoint (const QTouchEvent::TouchPoint &touchPoint)
 
QString appName () const
 
bool canQuit ()
 
void cleanupMultitouch ()
 
void cleanupMultitouch_sys ()
 
void closePopup (QWidget *popup)
 
void construct (Display *dpy=0, Qt::HANDLE visual=0, Qt::HANDLE cmap=0)
 
void createEventDispatcher ()
 
int findClosestTouchPointId (const QPointF &screenPos)
 
QPixmap getPixmapCursor (Qt::CursorShape cshape)
 
void initialize ()
 Initializes the QApplication object, called from the constructors. More...
 
void initializeMultitouch ()
 
void initializeMultitouch_sys ()
 
bool inPopupMode () const
 
QRect maxWindowRect (const QScreen *screen) const
 
bool notify_helper (QObject *receiver, QEvent *e)
 
void openPopup (QWidget *popup)
 
void process_cmdline ()
 
 QApplicationPrivate (int &argc, char **argv, QApplication::Type type, int flags)
 
void removeTouchPoint (int touchPointId)
 
void sendSyntheticEnterLeave (QWidget *widget)
 
void setMaxWindowRect (const QScreen *screen, int screenNo, const QRect &rect)
 
void setScreenTransformation (QScreen *screen, int screenNo, int transformation)
 
bool translateTouchEvent (const MSG &msg)
 
 ~QApplicationPrivate ()
 
- Public Functions inherited from QCoreApplicationPrivate
void appendApplicationPathToLibraryPaths (void)
 
void checkReceiverThread (QObject *receiver)
 
bool notify_helper (QObject *, QEvent *)
 
void processCommandLineArguments ()
 
 QCoreApplicationPrivate (int &aargc, char **aargv, uint flags)
 
bool sendThroughApplicationEventFilters (QObject *, QEvent *)
 
bool sendThroughObjectEventFilters (QObject *, QEvent *)
 
 ~QCoreApplicationPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static void applyX11SpecificCommandLineArguments (QWidget *main_widget)
 
static uint currentPlatform ()
 
static QString desktopStyleKey ()
 
static void dispatchEnterLeave (QWidget *enter, QWidget *leave)
 
static void emitLastWindowClosed ()
 
static void enterModal (QWidget *)
 
static void enterModal_sys (QWidget *)
 
static QWidgetfocusNextPrevChild_helper (QWidget *toplevel, bool next)
 internal Helper function that returns the new focus widget, but does not set the focus reason. More...
 
static OSStatus globalAppleEventProcessor (const AppleEvent *, AppleEvent *, long)
 
static OSStatus globalEventProcessor (EventHandlerCallRef, EventRef, void *)
 
static QGraphicsSystemgraphicsSystem ()
 
static void initializeWidgetPaletteHash ()
 
static QApplicationPrivateinstance ()
 
static bool isBlockedByModal (QWidget *widget)
 Returns true if widget is blocked by a modal window. More...
 
static void leaveModal (QWidget *)
 
static void leaveModal_sys (QWidget *)
 
static bool modalState ()
 
static QWidgetpickMouseReceiver (QWidget *candidate, const QPoint &globalPos, QPoint &pos, QEvent::Type type, Qt::MouseButtons buttons, QWidget *buttonDown, QWidget *alienWidget)
 
static bool qt_mac_apply_settings ()
 
static void reset_instance_pointer ()
 
static bool sendMouseEvent (QWidget *receiver, QMouseEvent *event, QWidget *alienWidget, QWidget *native, QWidget **buttonDown, QPointer< QWidget > &lastMouseReceiver, bool spontaneous=true)
 
static void setFocusWidget (QWidget *focus, Qt::FocusReason reason)
 
static void setPalette_helper (const QPalette &palette, const char *className, bool clearWidgetPaletteHash)
 
static void setSystemFont (const QFont &font)
 
static void setSystemPalette (const QPalette &pal)
 
static OSStatus tabletProximityCallback (EventHandlerCallRef, EventRef, void *)
 
static void translateRawTouchEvent (QWidget *widget, QTouchEvent::DeviceType deviceType, const QList< QTouchEvent::TouchPoint > &touchPoints)
 
static bool tryModalHelper (QWidget *widget, QWidget **rettop=0)
 
static QWidgettryModalHelper_sys (QWidget *top)
 
static void updateTouchPointsForWidget (QWidget *widget, QTouchEvent *touchEvent)
 
static bool x11_apply_settings ()
 
static void x11_initialize_style ()
 
- Static Public Functions inherited from QCoreApplicationPrivate
static bool checkInstance (const char *method)
 
static bool isTranslatorInstalled (QTranslator *translator)
 
static QString macMenuBarName ()
 
static QThreadmainThread ()
 
static QString qmljsDebugArguments ()
 
static void removePostedEvent (QEvent *)
 Removes event from the queue of posted events, and emits a warning message if appropriate. More...
 
static void removePostedTimerEvent (QObject *object, int timerId)
 
static void sendPostedEvents (QObject *receiver, int event_type, QThreadData *data)
 
static bool testAttribute (uint flag)
 
static QSettingstrolltechConf ()
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Public Variables

QHash< QWidget *, QTimer * > alertTimerHash
 
QMap< int, QTouchEvent::TouchPointappCurrentTouchPoints
 
PtrBeginPanningFeedback BeginPanningFeedback
 
PtrCloseGestureInfoHandle CloseGestureInfoHandle
 
QPixmapcopy_cursor
 
QList< QCursorcursor_list
 
QMap< WId, QDirectPainter * > * directPainters
 
PtrEndPanningFeedback EndPanningFeedback
 
QGestureManagergestureManager
 
QWidgetgestureWidget
 
PtrGetGestureConfig GetGestureConfig
 
PtrGetGestureExtraArgs GetGestureExtraArgs
 
PtrGetGestureInfo GetGestureInfo
 
QPoint hoverGlobalPos
 
QPixmapignore_cursor
 
bool is_session_restored
 
QPointer< QWSManager > last_manager
 
QPixmaplink_cursor
 
QPixmapmove_cursor
 
QWSServerCleaner qwsServerCleaner
 
QList< QGraphicsScene * > scene_list
 
QString session_id
 
QString session_key
 
QSessionManagersession_manager
 
PtrSetGestureConfig SetGestureConfig
 
QShortcutMap shortcutMap
 
QBasicTimer toolTipFallAsleep
 
QPoint toolTipGlobalPos
 
QPoint toolTipPos
 
QBasicTimer toolTipWakeUp
 
QPointer< QWidgettoolTipWidget
 
QHash< DWORD, int > touchInputIDToTouchPointID
 
PtrUpdatePanningFeedback UpdatePanningFeedback
 
QMap< int, QWeakPointer< QWidget > > widgetForTouchPointId
 
- Public Variables inherited from QCoreApplicationPrivate
bool aboutToQuitEmitted
 
uint application_type
 
QString applicationName
 
int & argc
 
char ** argv
 
QString cachedApplicationDirPath
 
QString cachedApplicationFilePath
 
QCoreApplication::EventFilter eventFilter
 
bool in_exec
 
QTranslatorList translators
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Static Public Variables

static QWidgetactive_window = 0
 
static bool animate_combo = false
 
static bool animate_menu = false
 
static bool animate_toolbox = false
 
static bool animate_tooltip = false
 
static bool animate_ui = true
 
static int app_cspec = QApplication::NormalColor
 
static QIconapp_icon = 0
 
static QPaletteapp_pal = 0
 
static QSize app_strut = QSize(0,0)
 
static QStyleapp_style = 0
 
static int autoMaximizeThreshold = -1
 
static bool autoSipEnabled = false
 
static PtrCloseTouchInputHandle CloseTouchInputHandle = 0
 
static int cursor_flash_time = 1000
 
static bool fade_menu = false
 
static bool fade_tooltip = false
 
static QWidgetfocus_widget = 0
 
static PtrGetTouchInputInfo GetTouchInputInfo = 0
 
static QGraphicsSystemgraphics_system = 0
 
static QString graphics_system_name
 
static bool HasTouchSupport = false
 
static QWidgethidden_focus_widget = 0
 
static QInputContextinputContext = 0
 
static int keyboard_input_time = 400
 
static QPointer< QWidgetleaveAfterRelease = 0
 
static bool load_testability = false
 
static QWidgetmain_widget = 0
 
static Qt::KeyboardModifiers modifier_buttons = Qt::NoModifier
 
static Qt::MouseButtons mouse_buttons = Qt::NoButton
 
static int mouse_double_click_time = 400
 
static bool native_modal_dialog_active
 
static bool obey_desktop_settings = true
 
static QWidgetListpopupWidgets = 0
 
static bool quitOnLastWindowClosed = true
 
static PtrRegisterTouchWindow RegisterTouchWindow = 0
 
static bool runtime_graphics_system = false
 
static QFontset_font = 0
 
static QPaletteset_pal = 0
 
static QString styleOverride
 
static QString styleSheet
 
static QFontsys_font = 0
 
static QPalettesys_pal = 0
 
static int wheel_scroll_lines
 
static bool widgetCount = false
 
- Static Public Variables inherited from QCoreApplicationPrivate
static int app_compile_version = 0x040000
 
static uint attribs
 
static QAbstractEventDispatchereventDispatcher = 0
 
static bool is_app_closing = false
 
static bool is_app_running = false
 
static QThreadtheMainThread = 0
 

Static Private Functions

static void giveFocusAccordingToFocusPolicy (QWidget *w, Qt::FocusPolicy focusPolicy, Qt::FocusReason focusReason)
 
static bool isAlien (QWidget *)
 
static bool shouldSetFocus (QWidget *w, Qt::FocusPolicy policy)
 

Properties

QMap< const QScreen *, QRectmaxWindowRects
 

Static Private Attributes

static QFontapp_font = 0
 
static QApplicationPrivateself = 0
 

Detailed Description

Definition at line 286 of file qapplication_p.h.

Enumerations

◆ KeyPlatform

Enumerator
KB_Win 
KB_Mac 
KB_X11 
KB_KDE 
KB_Gnome 
KB_CDE 
KB_S60 
KB_All 

Definition at line 356 of file qapplication_p.h.

Constructors and Destructors

◆ QApplicationPrivate()

QApplicationPrivate::QApplicationPrivate ( int &  argc,
char **  argv,
QApplication::Type  type,
int  flags 
)

Definition at line 181 of file qapplication.cpp.

183 {
185  qt_appType = type;
186 
187 #ifndef QT_NO_SESSIONMANAGER
188  is_session_restored = false;
189 #endif
190 
191  quitOnLastWindowClosed = true;
192 
193 #ifdef QT3_SUPPORT
194  qt_compat_used = 0;
195  qt_compat_resolved = 0;
196  qt_tryAccelEvent = 0;
197  qt_tryComposeUnicode = 0;
198  qt_dispatchAccelEvent = 0;
199 #endif
200 #if defined(Q_WS_QWS) && !defined(QT_NO_DIRECTPAINTER)
201  directPainters = 0;
202 #endif
203 
204 #ifndef QT_NO_GESTURES
205  gestureManager = 0;
206  gestureWidget = 0;
207 #endif // QT_NO_GESTURES
208 
209 #if defined(Q_WS_X11) || defined(Q_WS_WIN)
210  move_cursor = 0;
211  copy_cursor = 0;
212  link_cursor = 0;
213 #endif
214 #if defined(Q_WS_WIN)
215  ignore_cursor = 0;
216 #endif
217 
218  if (!self)
219  self = this;
220 }
int type
Definition: qmetatype.cpp:239
QCoreApplicationPrivate(int &aargc, char **aargv, uint flags)
static bool quitOnLastWindowClosed
QApplication::Type qt_appType
QMap< WId, QDirectPainter * > * directPainters
QGestureManager * gestureManager

◆ ~QApplicationPrivate()

QApplicationPrivate::~QApplicationPrivate ( )

Definition at line 222 of file qapplication.cpp.

223 {
224  if (self == this)
225  self = 0;
226 }

Functions

◆ _q_alertTimeOut()

void QApplicationPrivate::_q_alertTimeOut ( )

Definition at line 2774 of file qapplication_mac.mm.

Referenced by QApplication::syncX().

2775 {
2776  if (QTimer *timer = qobject_cast<QTimer *>(q_func()->sender())) {
2778  while (it != alertTimerHash.end()) {
2779  if (it.value() == timer) {
2780  alertTimerHash.erase(it);
2781  timer->deleteLater();
2782  break;
2783  }
2784  ++it;
2785  }
2786  if (alertTimerHash.isEmpty()) {
2788  }
2789  }
2790 }
#define it(className, varName)
EventLoopTimerRef timer
T & value() const
Returns a modifiable reference to the current item&#39;s value.
Definition: qhash.h:348
QHash< QWidget *, QTimer * > alertTimerHash
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Definition: qhash.h:297
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
void qt_mac_cancel_notification()
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
Definition: qhash.h:330
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464
The QTimer class provides repetitive and single-shot timers.
Definition: qtimer.h:56
iterator erase(iterator it)
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator...
Definition: qhash.h:827

◆ appendTouchPoint()

void QApplicationPrivate::appendTouchPoint ( const QTouchEvent::TouchPoint touchPoint)

◆ applyX11SpecificCommandLineArguments()

void QApplicationPrivate::applyX11SpecificCommandLineArguments ( QWidget main_widget)
static

Definition at line 2856 of file qapplication_x11.cpp.

Referenced by qt_nograb(), and QWidget::setVisible().

2857 {
2858  static bool beenHereDoneThat = false;
2859  if (beenHereDoneThat)
2860  return;
2861  beenHereDoneThat = true;
2863  if (mwTitle) {
2864  XStoreName(X11->display, main_widget->effectiveWinId(), (char*)mwTitle);
2866  XChangeProperty(X11->display, main_widget->effectiveWinId(), ATOM(_NET_WM_NAME), ATOM(UTF8_STRING), 8,
2867  PropModeReplace, (unsigned char *)net_wm_name.data(), net_wm_name.size());
2868  }
2869  if (mwGeometry) { // parse geometry
2870  int x, y;
2871  int w, h;
2872  int m = XParseGeometry((char*)mwGeometry, &x, &y, (uint*)&w, (uint*)&h);
2873  QSize minSize = main_widget->minimumSize();
2874  QSize maxSize = main_widget->maximumSize();
2875  if ((m & XValue) == 0)
2876  x = main_widget->geometry().x();
2877  if ((m & YValue) == 0)
2878  y = main_widget->geometry().y();
2879  if ((m & WidthValue) == 0)
2880  w = main_widget->width();
2881  if ((m & HeightValue) == 0)
2882  h = main_widget->height();
2883  w = qMin(w,maxSize.width());
2884  h = qMin(h,maxSize.height());
2885  w = qMax(w,minSize.width());
2886  h = qMax(h,minSize.height());
2887  if ((m & XNegative)) {
2888  x = QApplication::desktop()->width() + x - w;
2889  }
2890  if ((m & YNegative)) {
2891  y = QApplication::desktop()->height() + y - h;
2892  }
2893  main_widget->setGeometry(x, y, w, h);
2894  }
2895 }
#define YValue
QSize maximumSize
the widget&#39;s maximum size in pixels
Definition: qwidget.h:173
QSize minimumSize
the widget&#39;s minimum size
Definition: qwidget.h:172
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
int width
the width of the widget excluding any window frame
Definition: qwidget.h:166
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
Definition: qstring.cpp:4074
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define XValue
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define X11
Definition: qt_x11_p.h:724
int height() const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define ATOM(x)
Definition: qt_x11_p.h:723
int width() const
Returns the width.
Definition: qsize.h:126
int height
the height of the widget excluding any window frame
Definition: qwidget.h:167
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
int width() const
unsigned int uint
Definition: qglobal.h:996
#define YNegative
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
static const char * mwTitle
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
#define WidthValue
int height() const
Returns the height.
Definition: qsize.h:129
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
static const char * mwGeometry
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
#define HeightValue
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition: qwidget.h:158
#define XNegative

◆ appName()

QString QApplicationPrivate::appName ( ) const
virtual

Reimplemented from QCoreApplicationPrivate.

Definition at line 1097 of file qapplication_mac.mm.

Referenced by alert_widget(), qt_cleanup(), qt_init(), and qt_wstate_iconified().

1098 {
1099  static QString applName;
1100  if (applName.isEmpty()) {
1102  ProcessSerialNumber psn;
1103  if (applName.isEmpty() && qt_is_gui_used && GetCurrentProcess(&psn) == noErr) {
1104  QCFString cfstr;
1105  CopyProcessName(&psn, &cfstr);
1106  applName = cfstr;
1107  }
1108  }
1109  return applName;
1110 }
static QString macMenuBarName()
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
bool qt_is_gui_used

◆ canQuit()

bool QApplicationPrivate::canQuit ( )

Definition at line 3067 of file qapplication_mac.mm.

3068 {
3069 #ifndef QT_MAC_USE_COCOA
3070  return true;
3071 #else
3072  Q_Q(QApplication);
3073 #ifdef QT_MAC_USE_COCOA
3074  [[NSApp mainMenu] cancelTracking];
3075 #else
3076  HiliteMenu(0);
3077 #endif
3078 
3079  bool handle_quit = true;
3080  if (QApplicationPrivate::modalState() && [[[[QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) sharedDelegate]
3081  menuLoader] quitMenuItem] isEnabled]) {
3082  int visible = 0;
3084  for(int i = 0; i < tlws.size(); ++i) {
3085  if (tlws.at(i)->isVisible())
3086  ++visible;
3087  }
3088  handle_quit = (visible <= 1);
3089  }
3090  if (handle_quit) {
3091  QCloseEvent ev;
3093  if (ev.isAccepted()) {
3094  return true;
3095  }
3096  }
3097  return false;
3098 #endif
3099 }
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isAccepted() const
Definition: qcoreevent.h:307
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QCloseEvent class contains parameters that describe a close event.
Definition: qevent.h:364
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ cleanupMultitouch()

void QApplicationPrivate::cleanupMultitouch ( )

Definition at line 6009 of file qapplication.cpp.

6010 {
6012 
6015 }
QMap< int, QTouchEvent::TouchPoint > appCurrentTouchPoints
QMap< int, QWeakPointer< QWidget > > widgetForTouchPointId
void clear()
Removes all items from the map.
Definition: qmap.h:444

◆ cleanupMultitouch_sys()

void QApplicationPrivate::cleanupMultitouch_sys ( )

Definition at line 3172 of file qapplication_mac.mm.

Referenced by QSessionManager::cancel(), and QApplication::setArgs().

3173 { }

◆ closePopup()

void QApplicationPrivate::closePopup ( QWidget popup)
Warning
This function is not part of the public interface.

Definition at line 2697 of file qapplication_mac.mm.

Referenced by qt_try_modal().

2698 {
2699  Q_Q(QApplication);
2701  return;
2702 
2704  if (popup == qt_button_down)
2705  qt_button_down = 0;
2706  if (QApplicationPrivate::popupWidgets->isEmpty()) { // this was the last popup
2709 
2710  // Special case for Tool windows: since they are activated and deactived together
2711  // with a normal window they never become the QApplicationPrivate::active_window.
2712  QWidget *appFocusWidget = QApplication::focusWidget();
2713  if (appFocusWidget && appFocusWidget->window()->windowType() == Qt::Tool) {
2714  appFocusWidget->setFocus(Qt::PopupFocusReason);
2716  if (QWidget *fw = QApplicationPrivate::active_window->focusWidget()) {
2717  if (fw != QApplication::focusWidget()) {
2718  fw->setFocus(Qt::PopupFocusReason);
2719  } else {
2721  q->sendEvent(fw, &e);
2722  }
2723  }
2724  }
2725  } else {
2726  // popups are not focus-handled by the window system (the
2727  // first popup grabbed the keyboard), so we have to do that
2728  // manually: A popup was closed, so the previous popup gets
2729  // the focus.
2731  if (QWidget *fw = aw->focusWidget())
2732  fw->setFocus(Qt::PopupFocusReason);
2733  }
2734 }
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
QWidget * focusWidget() const
Returns the last child of this widget that setFocus had been called on.
Definition: qwidget.cpp:6863
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QWidget * active_window
#define Q_Q(Class)
Definition: qglobal.h:2483
static bool isEmpty(const char *str)
static QWidgetList * popupWidgets
void setFocus()
Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its paren...
Definition: qwidget.h:432
QWidget * qt_button_down
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
The QFocusEvent class contains event parameters for widget focus events.
Definition: qevent.h:275
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ construct()

void QApplicationPrivate::construct ( Display dpy = 0,
Qt::HANDLE  visual = 0,
Qt::HANDLE  cmap = 0 
)
Warning
This function is not part of the public interface.

Definition at line 815 of file qapplication.cpp.

820 {
821  initResources();
822 
824  process_cmdline();
825  // the environment variable has the lowest precedence of runtime graphicssystem switches
827  graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM"));
828 
829 #if defined(Q_WS_X11) && !defined(QT_NO_EGL)
831  bool linksWithMeeGoTouch = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libmeegotouchcore"));
832  bool linksWithMeeGoGraphicsSystemHelper = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libQtMeeGoGraphicsSystemHelper"));
833 
834  if (linksWithMeeGoTouch && !linksWithMeeGoGraphicsSystemHelper) {
835  qWarning("Running non-meego graphics system enabled MeeGo touch, forcing native graphicssystem\n");
837  }
838  }
839 #endif
840 
841  // Must be called before initialize()
842  qt_init(this, qt_appType
843 #ifdef Q_WS_X11
844  , dpy, visual, cmap
845 #endif
846  );
847  initialize();
849 
850 #ifdef QT_EVAL
851  extern void qt_gui_eval_init(uint);
852  qt_gui_eval_init(application_type);
853 #endif
854 
855 #if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
856  symbianInit();
857 #endif
858 
859 #ifndef QT_NO_LIBRARY
860  if(load_testability) {
861  QLibrary testLib(QLatin1String("qttestability"));
862  if (testLib.load()) {
863  typedef void (*TasInitialize)(void);
864  TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
865 #ifdef Q_OS_SYMBIAN
866  // resolving method by name does not work on Symbian OS so need to use ordinal
867  if(!initFunction) {
868  initFunction = (TasInitialize)testLib.resolve("1");
869  }
870 #endif
871  if (initFunction) {
872  initFunction();
873  } else {
874  qCritical("Library qttestability resolve failed!");
875  }
876  } else {
877  qCritical("Library qttestability load failed!");
878  }
879  }
880 
881  //make sure the plugin is loaded
882  if (qt_is_gui_used)
884 #endif
885 
886 #ifdef Q_OS_SYMBIAN
887  symbianHandleLiteModeStartup();
888 #endif
889 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
void initialize()
Initializes the QApplication object, called from the constructors.
static QColor cmap[256]
Definition: qgl_mac.mm:760
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QGuiPlatformPlugin * qt_guiPlatformPlugin()
Return (an construct if necesseray) the Gui Platform plugin.
static bool load_testability
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
Q_CORE_EXPORT void qWarning(const char *,...)
unsigned int uint
Definition: qglobal.h:996
static QString graphics_system_name
static int qt_matchLibraryName(dl_phdr_info *info, size_t, void *data)
void qt_init(QApplicationPrivate *priv, int type, Display *display=0, Qt::HANDLE visual=0, Qt::HANDLE colormap=0)
static QAbstractEventDispatcher * eventDispatcher
QApplication::Type qt_appType
bool qt_is_gui_used
static void initResources()
Q_CORE_EXPORT void qCritical(const char *,...)
The QLibrary class loads shared libraries at runtime.
Definition: qlibrary.h:62

◆ createEventDispatcher()

void QApplicationPrivate::createEventDispatcher ( )
virtual

Reimplemented from QCoreApplicationPrivate.

Definition at line 968 of file qapplication_mac.mm.

Referenced by QETWidget::doDeferredMap(), QGuiEventDispatcherWin32::processEvents(), and QETWidget::raiseOnClick().

969 {
970  Q_Q(QApplication);
971  if (q->type() != QApplication::Tty)
973  else
975 }
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
#define Q_Q(Class)
Definition: qglobal.h:2483
static QAbstractEventDispatcher * eventDispatcher

◆ currentPlatform()

uint QApplicationPrivate::currentPlatform ( )
static

Definition at line 5761 of file qapplication.cpp.

Referenced by QKeySequence::keyBindings(), and QKeyEvent::matches().

5761  {
5762  uint platform = KB_Win;
5763 #ifdef Q_WS_MAC
5764  platform = KB_Mac;
5765 #elif defined Q_WS_X11
5766  platform = KB_X11;
5767  if (X11->desktopEnvironment == DE_KDE)
5768  platform |= KB_KDE;
5769  if (X11->desktopEnvironment == DE_GNOME)
5770  platform |= KB_Gnome;
5771  if (X11->desktopEnvironment == DE_CDE)
5772  platform |= KB_CDE;
5773 #elif defined(Q_OS_SYMBIAN)
5774  platform = KB_S60;
5775 #endif
5776  return platform;
5777 }
#define X11
Definition: qt_x11_p.h:724
unsigned int uint
Definition: qglobal.h:996

◆ desktopStyleKey()

QString QApplicationPrivate::desktopStyleKey ( )
static
Warning
This function is not part of the public interface.

Definition at line 2136 of file qapplication.cpp.

Referenced by QProxyStylePrivate::ensureBaseStyle(), and QApplication::style().

2137 {
2138  return qt_guiPlatformPlugin()->styleName();
2139 }
QGuiPlatformPlugin * qt_guiPlatformPlugin()
Return (an construct if necesseray) the Gui Platform plugin.
virtual QString styleName()

◆ dispatchEnterLeave()

void QApplicationPrivate::dispatchEnterLeave ( QWidget enter,
QWidget leave 
)
static
Warning
This function is not part of the public interface.

Creates the proper Enter/Leave event when widget enter is entered and widget leave is left.

Definition at line 2778 of file qapplication.cpp.

Referenced by flipPoint(), globalEventProcessor(), QWidgetPrivate::hide_sys(), QGraphicsProxyWidget::hoverLeaveEvent(), QGraphicsProxyWidget::hoverMoveEvent(), qt_cleanup(), QtWndProc(), QApplication::qwsProcessEvent(), QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(), QWidgetPrivate::show_sys(), QETWidget::translateMouseEvent(), QApplication::x11EventFilter(), and QApplication::x11ProcessEvent().

2778  {
2779 #if 0
2780  if (leave) {
2781  QEvent e(QEvent::Leave);
2782  QApplication::sendEvent(leave, & e);
2783  }
2784  if (enter) {
2785  QEvent e(QEvent::Enter);
2786  QApplication::sendEvent(enter, & e);
2787  }
2788  return;
2789 #endif
2790 
2791  QWidget* w ;
2792  if ((!enter && !leave) || (enter == leave))
2793  return;
2794 #ifdef ALIEN_DEBUG
2795  qDebug() << "QApplicationPrivate::dispatchEnterLeave, ENTER:" << enter << "LEAVE:" << leave;
2796 #endif
2797  QWidgetList leaveList;
2798  QWidgetList enterList;
2799 
2800  bool sameWindow = leave && enter && leave->window() == enter->window();
2801  if (leave && !sameWindow) {
2802  w = leave;
2803  do {
2804  leaveList.append(w);
2805  } while (!w->isWindow() && (w = w->parentWidget()));
2806  }
2807  if (enter && !sameWindow) {
2808  w = enter;
2809  do {
2810  enterList.prepend(w);
2811  } while (!w->isWindow() && (w = w->parentWidget()));
2812  }
2813  if (sameWindow) {
2814  int enterDepth = 0;
2815  int leaveDepth = 0;
2816  w = enter;
2817  while (!w->isWindow() && (w = w->parentWidget()))
2818  enterDepth++;
2819  w = leave;
2820  while (!w->isWindow() && (w = w->parentWidget()))
2821  leaveDepth++;
2822  QWidget* wenter = enter;
2823  QWidget* wleave = leave;
2824  while (enterDepth > leaveDepth) {
2825  wenter = wenter->parentWidget();
2826  enterDepth--;
2827  }
2828  while (leaveDepth > enterDepth) {
2829  wleave = wleave->parentWidget();
2830  leaveDepth--;
2831  }
2832  while (!wenter->isWindow() && wenter != wleave) {
2833  wenter = wenter->parentWidget();
2834  wleave = wleave->parentWidget();
2835  }
2836 
2837  w = leave;
2838  while (w != wleave) {
2839  leaveList.append(w);
2840  w = w->parentWidget();
2841  }
2842  w = enter;
2843  while (w != wenter) {
2844  enterList.prepend(w);
2845  w = w->parentWidget();
2846  }
2847  }
2848 
2849  QEvent leaveEvent(QEvent::Leave);
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;
2856 #endif
2857  QApplication::sendEvent(w, &leaveEvent);
2858  if (w->testAttribute(Qt::WA_Hover) &&
2860  Q_ASSERT(instance());
2862  qApp->d_func()->notify_helper(w, &he);
2863  }
2864  }
2865  }
2866  QPoint posEnter = QCursor::pos();
2867  QEvent enterEvent(QEvent::Enter);
2868  for (int i = 0; i < enterList.size(); ++i) {
2869  w = enterList.at(i);
2871  QApplication::sendEvent(w, &enterEvent);
2872  if (w->testAttribute(Qt::WA_Hover) &&
2874  QHoverEvent he(QEvent::HoverEnter, w->mapFromGlobal(posEnter), QPoint(-1, -1));
2875  qApp->d_func()->notify_helper(w, &he);
2876  }
2877  }
2878  }
2879 
2880 #ifndef QT_NO_CURSOR
2881  // Update cursor for alien/graphics widgets.
2882 
2883  const bool enterOnAlien = (enter && (isAlien(enter) || enter->testAttribute(Qt::WA_DontShowOnScreen)));
2884 #if defined(Q_WS_X11) || defined(Q_WS_QPA)
2885  //Whenever we leave an alien widget on X11, we need to reset its nativeParentWidget()'s cursor.
2886  // This is not required on Windows as the cursor is reset on every single mouse move.
2887  QWidget *parentOfLeavingCursor = 0;
2888  for (int i = 0; i < leaveList.size(); ++i) {
2889  w = leaveList.at(i);
2890  if (!isAlien(w))
2891  break;
2892  if (w->testAttribute(Qt::WA_SetCursor)) {
2893  QWidget *parent = w->parentWidget();
2894  while (parent && parent->d_func()->data.in_destructor)
2895  parent = parent->parentWidget();
2896  parentOfLeavingCursor = parent;
2897  //continue looping, we need to find the downest alien widget with a cursor.
2898  // (downest on the screen)
2899  }
2900  }
2901  //check that we will not call qt_x11_enforce_cursor twice with the same native widget
2902  if (parentOfLeavingCursor && (!enterOnAlien
2903  || parentOfLeavingCursor->effectiveWinId() != enter->effectiveWinId())) {
2904 #ifndef QT_NO_GRAPHICSVIEW
2905  if (!parentOfLeavingCursor->window()->graphicsProxyWidget())
2906 #endif
2907  {
2908 #if defined(Q_WS_X11)
2909  qt_x11_enforce_cursor(parentOfLeavingCursor,true);
2910 #elif defined(Q_WS_QPA)
2911  if (enter == QApplication::desktop()) {
2912  qt_qpa_set_cursor(enter, true);
2913  } else {
2914  qt_qpa_set_cursor(parentOfLeavingCursor, true);
2915  }
2916 #endif
2917  }
2918  }
2919 #endif
2920  if (enterOnAlien) {
2921  QWidget *cursorWidget = enter;
2922  while (!cursorWidget->isWindow() && !cursorWidget->isEnabled())
2923  cursorWidget = cursorWidget->parentWidget();
2924 
2925  if (!cursorWidget)
2926  return;
2927 
2928 #ifndef QT_NO_GRAPHICSVIEW
2929  if (cursorWidget->window()->graphicsProxyWidget()) {
2930  QWidgetPrivate::nearestGraphicsProxyWidget(cursorWidget)->setCursor(cursorWidget->cursor());
2931  } else
2932 #endif
2933  {
2934 #if defined(Q_WS_WIN)
2935  qt_win_set_cursor(cursorWidget, true);
2936 #elif defined(Q_WS_X11)
2937  qt_x11_enforce_cursor(cursorWidget, true);
2938 #elif defined(Q_OS_SYMBIAN)
2939  qt_symbian_set_cursor(cursorWidget, true);
2940 #elif defined(Q_WS_QPA)
2941  qt_qpa_set_cursor(cursorWidget, true);
2942 #endif
2943  }
2944  }
2945 #endif
2946 }
static QPointer< QWidget > leaveAfterRelease
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
The QHoverEvent class contains parameters that describe a mouse event.
Definition: qevent.h:125
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QApplicationPrivate * instance()
QGraphicsProxyWidget * graphicsProxyWidget() const
Returns the proxy widget for the corresponding embedded widget in a graphics view; otherwise returns ...
Definition: qwidget.cpp:12939
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void qt_x11_enforce_cursor(QWidget *w, bool force)
Update the X11 cursor of the widget w.
Q_CORE_EXPORT void qDebug(const char *,...)
static QWidget * activeModalWidget()
Returns the active modal widget.
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.
Definition: qlist.h:507
void qt_qpa_set_cursor(QWidget *w, bool force)
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
#define qApp
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QWidgetData * data
Definition: qwidget.h:815
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QCursor cursor
the cursor shape for this widget
Definition: qwidget.h:183
bool isEnabled() const
Definition: qwidget.h:948
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
static bool tryModalHelper(QWidget *widget, QWidget **rettop=0)
static QWidget * activePopupWidget()
Returns the active popup widget.
void qt_win_set_cursor(QWidget *, bool)
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
QObject * parent
Definition: qobject.h:92
uint in_destructor
Definition: qwidget.h:129
static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin)
Finds the nearest widget embedded in a graphics proxy widget along the chain formed by this widget an...
Definition: qwidget.cpp:6098
static bool isAlien(QWidget *)
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
Definition: qcursor_mac.mm:310
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ emitLastWindowClosed()

void QApplicationPrivate::emitLastWindowClosed ( )
static

Definition at line 5338 of file qapplication.cpp.

Referenced by QWidgetPrivate::close_helper().

5339 {
5340  if (qApp && qApp->d_func()->in_exec) {
5342  // get ready to quit, this event might be removed if the
5343  // event loop is re-entered, however
5345  }
5346  emit qApp->lastWindowClosed();
5347  }
5348 }
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...
#define qApp
#define emit
Definition: qobjectdefs.h:76
static bool quitOnLastWindowClosed
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56

◆ enterModal()

void QApplicationPrivate::enterModal ( QWidget widget)
static
Warning
This function is not part of the public interface.

Definition at line 3051 of file qapplication.cpp.

Referenced by QPageSetupDialogPrivate::openCarbonPageLayout(), QPrintDialogPrivate::openCarbonPrintPanel(), QGtkStylePrivate::openDirectory(), QGtkStylePrivate::openFilename(), QGtkStylePrivate::openFilenames(), QPrintDialogPrivate::openWindowsPrintDialogModally(), QAxClientSite::qt_metacall(), qt_win_get_existing_directory(), qt_win_get_open_file_name(), qt_win_get_open_file_names(), qt_win_get_save_file_name(), QGtkStylePrivate::saveFilename(), and QWidgetPrivate::show_helper().

3052 {
3053  QSet<QWidget*> blocked;
3055  for (int i = 0; i < windows.count(); ++i) {
3056  QWidget *window = windows.at(i);
3057  if (window->windowType() != Qt::Tool && isBlockedByModal(window))
3058  blocked.insert(window);
3059  }
3060 
3061  enterModal_sys(widget);
3062 
3063  windows = QApplication::topLevelWidgets();
3065  for (int i = 0; i < windows.count(); ++i) {
3066  QWidget *window = windows.at(i);
3067  if (!blocked.contains(window) && window->windowType() != Qt::Tool && isBlockedByModal(window))
3068  QApplication::sendEvent(window, &e);
3069  }
3070 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
NSWindow * window
bool contains(const T &value) const
Definition: qset.h:91
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
const_iterator insert(const T &value)
Definition: qset.h:179
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
static void enterModal_sys(QWidget *)
static bool isBlockedByModal(QWidget *widget)
Returns true if widget is blocked by a modal window.
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56

◆ enterModal_sys()

void QApplicationPrivate::enterModal_sys ( QWidget widget)
static

Definition at line 1511 of file qapplication_mac.mm.

Referenced by qt_try_modal(), QtWndProc(), QApplication::qwsSetCustomColors(), and QApplication::x11EventFilter().

1512 {
1513 #ifdef DEBUG_MODAL_EVENTS
1514  Q_ASSERT(widget);
1515  qDebug("Entering modal state with %s::%s::%p (%d)", widget->metaObject()->className(), widget->objectName().toLocal8Bit().constData(),
1516  widget, qt_modal_stack ? (int)qt_modal_stack->count() : -1);
1517 #endif
1518  if (!qt_modal_stack)
1520 
1523 
1524  qt_modal_stack->insert(0, widget);
1525  if (!app_do_modal)
1527  app_do_modal = true;
1528  qt_button_down = 0;
1529 
1530 #ifdef QT_MAC_USE_COCOA
1531  if (!qt_mac_is_macsheet(widget))
1532  QEventDispatcherMacPrivate::beginModalSession(widget);
1533 #endif
1534 }
QPointer< QWidget > qt_last_mouse_receiver
QPointer< QWidget > widget
QList< QWidget * > QWidgetList
Definition: qwindowdefs.h:89
void insert(int i, const T &t)
Inserts value at index position i in the list.
Definition: qlist.h:575
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_CORE_EXPORT void qDebug(const char *,...)
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
Definition: qstring.cpp:4049
QWidgetList * qt_modal_stack
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
QWidget * qt_button_down
const char * className() const
Returns the class name.
Definition: qobjectdefs.h:491
QString objectName() const
bool qt_mac_is_macsheet(const QWidget *)
Definition: qwidget_mac.mm:295
static void dispatchEnterLeave(QWidget *enter, QWidget *leave)
static bool app_do_modal
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
void qt_event_request_menubarupdate()

◆ findClosestTouchPointId()

int QApplicationPrivate::findClosestTouchPointId ( const QPointF screenPos)

Definition at line 6017 of file qapplication.cpp.

Referenced by translateRawTouchEvent().

6018 {
6019  int closestTouchPointId = -1;
6020  qreal closestDistance = qreal(0.);
6021  foreach (const QTouchEvent::TouchPoint &touchPoint, appCurrentTouchPoints) {
6022  qreal distance = QLineF(screenPos, touchPoint.screenPos()).length();
6023  if (closestTouchPointId == -1 || distance < closestDistance) {
6024  closestTouchPointId = touchPoint.id();
6025  closestDistance = distance;
6026  }
6027  }
6028  return closestTouchPointId;
6029 }
int id() const
Returns the id number of this touch point.
Definition: qevent.cpp:4445
double qreal
Definition: qglobal.h:1193
QMap< int, QTouchEvent::TouchPoint > appCurrentTouchPoints
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
static int distance(QWidget *source, QWidget *target, QAccessible::RelationFlag relation)
QPointF screenPos() const
Returns the screen position of this touch point.
Definition: qevent.cpp:4498
The TouchPoint class provides information about a touch point in a QTouchEvent.
Definition: qevent.h:744

◆ focusNextPrevChild_helper()

QWidget * QApplicationPrivate::focusNextPrevChild_helper ( QWidget toplevel,
bool  next 
)
static

internal Helper function that returns the new focus widget, but does not set the focus reason.

Returns 0 if a new focus widget could not be found. Shared with QGraphicsProxyWidgetPrivate::findFocusChild()

Definition at line 2739 of file qapplication.cpp.

Referenced by QWidget::focusNextPrevChild(), and QApplication::setActiveWindow().

2740 {
2742 
2743  QWidget *f = toplevel->focusWidget();
2744  if (!f)
2745  f = toplevel;
2746 
2747  QWidget *w = f;
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)
2752  && test->isVisibleTo(toplevel) && test->isEnabled()
2753  && !(w->windowType() == Qt::SubWindow && !w->isAncestorOf(test))
2754  && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))) {
2755  w = test;
2756  if (next)
2757  break;
2758  }
2759  test = test->d_func()->focus_next;
2760  }
2761  if (w == f) {
2762  if (qt_in_tab_key_event) {
2764  w->update();
2765  }
2766  return 0;
2767  }
2768  return w;
2769 }
QWidget * focusWidget() const
Returns the last child of this widget that setFocus had been called on.
Definition: qwidget.cpp:6863
bool isVisibleTo(QWidget *) const
Returns true if this widget would become visible if ancestor is shown; otherwise returns false...
Definition: qwidget.cpp:8371
Qt::FocusPolicy focusPolicy
the way the widget accepts keyboard focus
Definition: qwidget.h:187
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
unsigned int uint
Definition: qglobal.h:996
bool Q_GUI_EXPORT qt_tab_all_widgets
bool isEnabled() const
Definition: qwidget.h:948
bool isAncestorOf(const QWidget *child) const
Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child...
Definition: qwidget.cpp:8573
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
bool qt_in_tab_key_event

◆ getPixmapCursor()

QPixmap QApplicationPrivate::getPixmapCursor ( Qt::CursorShape  cshape)

Definition at line 6404 of file qapplication.cpp.

Referenced by create32BitCursor(), QDragManager::dragCursor(), and QCursor::QCursor().

6405 {
6406 #if defined(Q_WS_X11) || defined(Q_WS_WIN)
6407  if (!move_cursor) {
6408  move_cursor = new QPixmap((const char **)move_xpm);
6409  copy_cursor = new QPixmap((const char **)copy_xpm);
6410  link_cursor = new QPixmap((const char **)link_xpm);
6411 #ifdef Q_WS_WIN
6412  ignore_cursor = new QPixmap((const char **)ignore_xpm);
6413 #endif
6414  }
6415 
6416  switch (cshape) {
6417  case Qt::DragMoveCursor:
6418  return *move_cursor;
6419  case Qt::DragCopyCursor:
6420  return *copy_cursor;
6421  case Qt::DragLinkCursor:
6422  return *link_cursor;
6423 #ifdef Q_WS_WIN
6424  case Qt::ForbiddenCursor:
6425  return *ignore_cursor;
6426 #endif
6427  default:
6428  break;
6429  }
6430 #else
6431  Q_UNUSED(cshape);
6432 #endif
6433  return QPixmap();
6434 }
static const char *const ignore_xpm[]
static const char *const copy_xpm[]
static const char *const move_xpm[]
static const char *const link_xpm[]
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ giveFocusAccordingToFocusPolicy()

void QApplicationPrivate::giveFocusAccordingToFocusPolicy ( QWidget w,
Qt::FocusPolicy  focusPolicy,
Qt::FocusReason  focusReason 
)
staticprivate

Definition at line 5815 of file qapplication.cpp.

Referenced by QApplication::notify().

5818 {
5819  QWidget *focusWidget = widget;
5820  while (focusWidget) {
5821  if (focusWidget->isEnabled()
5822  && QApplicationPrivate::shouldSetFocus(focusWidget, focusPolicy)) {
5823  focusWidget->setFocus(focusReason);
5824  break;
5825  }
5826  if (focusWidget->isWindow())
5827  break;
5828  focusWidget = focusWidget->parentWidget();
5829  }
5830 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
QPointer< QWidget > widget
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
bool isEnabled() const
Definition: qwidget.h:948
void setFocus()
Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its paren...
Definition: qwidget.h:432
static bool shouldSetFocus(QWidget *w, Qt::FocusPolicy policy)

◆ globalAppleEventProcessor()

OSStatus QApplicationPrivate::globalAppleEventProcessor ( const AppleEvent ae,
AppleEvent ,
long  handlerRefcon 
)
static

Definition at line 2575 of file qapplication_mac.mm.

Referenced by qt_init().

2576 {
2577  QApplication *app = (QApplication *)handlerRefcon;
2578  bool handled_event=false;
2579  OSType aeID=typeWildCard, aeClass=typeWildCard;
2580  AEGetAttributePtr(ae, keyEventClassAttr, typeType, 0, &aeClass, sizeof(aeClass), 0);
2581  AEGetAttributePtr(ae, keyEventIDAttr, typeType, 0, &aeID, sizeof(aeID), 0);
2582  if(aeClass == kCoreEventClass) {
2583  switch(aeID) {
2584  case kAEQuitApplication: {
2585  extern bool qt_mac_quit_menu_item_enabled; // qmenu_mac.cpp
2586  if (qt_mac_quit_menu_item_enabled) {
2587  QCloseEvent ev;
2589  if(ev.isAccepted()) {
2590  handled_event = true;
2591  app->quit();
2592  }
2593  } else {
2594  QApplication::beep(); // Sorry, you can't quit right now.
2595  }
2596  break; }
2597  case kAEOpenDocuments: {
2598  AEDescList docs;
2599  if(AEGetParamDesc(ae, keyDirectObject, typeAEList, &docs) == noErr) {
2600  long cnt = 0;
2601  AECountItems(&docs, &cnt);
2602  UInt8 *str_buffer = NULL;
2603  for(int i = 0; i < cnt; i++) {
2604  FSRef ref;
2605  if(AEGetNthPtr(&docs, i+1, typeFSRef, 0, 0, &ref, sizeof(ref), 0) != noErr)
2606  continue;
2607  if(!str_buffer)
2608  str_buffer = (UInt8 *)malloc(1024);
2609  FSRefMakePath(&ref, str_buffer, 1024);
2610  QFileOpenEvent ev(QString::fromUtf8((const char *)str_buffer));
2612  }
2613  if(str_buffer)
2614  free(str_buffer);
2615  }
2616  break; }
2617  default:
2618  break;
2619  }
2620  } else if (aeClass == kInternetEventClass) {
2621  switch (aeID) {
2622  case kAEGetURL: {
2623  char urlData[1024];
2624  Size actualSize;
2625  if (AEGetParamPtr(ae, keyDirectObject, typeChar, 0, urlData,
2626  sizeof(urlData) - 1, &actualSize) == noErr) {
2627  urlData[actualSize] = 0;
2628  QFileOpenEvent ev(QUrl(QString::fromUtf8(urlData)));
2630  }
2631  break;
2632  }
2633  default:
2634  break;
2635  }
2636  }
2637 #ifdef DEBUG_EVENTS
2638  qDebug("Qt: internal: %shandled Apple event! %c%c%c%c %c%c%c%c", handled_event ? "(*)" : "",
2639  char(aeID >> 24), char((aeID >> 16) & 255), char((aeID >> 8) & 255),char(aeID & 255),
2640  char(aeClass >> 24), char((aeClass >> 16) & 255), char((aeClass >> 8) & 255),char(aeClass & 255));
2641 #else
2642  if(!handled_event) //let the event go through
2643  return eventNotHandledErr;
2644  return noErr; //we eat the event
2645 #endif
2646 }
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
static void beep()
Sounds the bell, using the default volume and sound.
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
bool qt_mac_quit_menu_item_enabled
Definition: qmenu_mac.mm:75
Q_CORE_EXPORT void qDebug(const char *,...)
static void quit()
Tells the application to exit with return code 0 (success).
bool isAccepted() const
Definition: qcoreevent.h:307
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Definition: qstring.cpp:4302
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)
struct AEDesc AEDescList
The QCloseEvent class contains parameters that describe a close event.
Definition: qevent.h:364
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file o...
Definition: qevent.h:644

◆ globalEventProcessor()

OSStatus QApplicationPrivate::globalEventProcessor ( EventHandlerCallRef  er,
EventRef  event,
void *  data 
)
static

Definition at line 1635 of file qapplication_mac.mm.

Referenced by qt_init().

1636 {
1637 #ifndef QT_MAC_USE_COCOA
1638  QApplication *app = (QApplication *)data;
1639  QScopedLoopLevelCounter loopLevelCounter(app->d_func()->threadData);
1640  long result;
1641  if (app->filterEvent(&event, &result))
1642  return result;
1643  if(app->macEventFilter(er, event)) //someone else ate it
1644  return noErr;
1646 
1647  /*We assume all events are handled and in
1648  the code below we set it to false when we know we didn't handle it, this
1649  will let rogue events through (shouldn't really happen, but better safe
1650  than sorry) */
1651  bool handled_event=true;
1652  UInt32 ekind = GetEventKind(event), eclass = GetEventClass(event);
1653  switch(eclass)
1654  {
1655  case kEventClassQt:
1656  if(ekind == kEventQtRequestShowSheet) {
1658  QWidget *widget = 0;
1659  GetEventParameter(event, kEventParamQWidget, typeQWidget, 0,
1660  sizeof(widget), 0, &widget);
1661  if(widget) {
1662  if (widget->macEvent(er, event))
1663  return noErr;
1664  WindowPtr window = qt_mac_window_for(widget);
1665  bool just_show = !qt_mac_is_macsheet(widget);
1666  if(!just_show) {
1667  OSStatus err = ShowSheetWindow(window, qt_mac_window_for(widget->parentWidget()));
1668  if(err != noErr)
1669  qWarning("Qt: QWidget: Unable to show as sheet %s::%s [%ld]", widget->metaObject()->className(),
1670  widget->objectName().toLocal8Bit().constData(), long(err));
1671  just_show = true;
1672  }
1673  if(just_show) //at least the window will be visible, but the sheet flag doesn't work sadly (probalby too many sheets)
1674  ShowHide(window, true);
1675  }
1676  } else if(ekind == kEventQtRequestWindowChange) {
1678  } else if(ekind == kEventQtRequestMenubarUpdate) {
1681  } else if(ekind == kEventQtRequestActivate) {
1683  if(request_activate_pending.widget) {
1684  QWidget *tlw = request_activate_pending.widget->window();
1685  if (tlw->macEvent(er, event))
1686  return noErr;
1687  request_activate_pending.widget = 0;
1688  tlw->activateWindow();
1689  SelectWindow(qt_mac_window_for(tlw));
1690  }
1691  } else if(ekind == kEventQtRequestContext) {
1692  bool send = false;
1693  if ((send = (event == request_context_pending)))
1695  if(send) {
1696  //figure out which widget to send it to
1697  QPoint where = QCursor::pos();
1698  QWidget *widget = 0;
1699  GetEventParameter(event, kEventParamQWidget, typeQWidget, 0,
1700  sizeof(widget), 0, &widget);
1701  if(!widget) {
1702  if(qt_button_down)
1703  widget = qt_button_down;
1704  else
1705  widget = QApplication::widgetAt(where.x(), where.y());
1706  }
1707  if(widget && !isBlockedByModal(widget)) {
1708  if (widget->macEvent(er, event))
1709  return noErr;
1710  QPoint plocal(widget->mapFromGlobal(where));
1711  const Qt::KeyboardModifiers keyboardModifiers = qt_mac_get_modifiers(GetCurrentEventKeyModifiers());
1712  QContextMenuEvent qme(QContextMenuEvent::Mouse, plocal, where, keyboardModifiers);
1713  QApplication::sendEvent(widget, &qme);
1714  if(qme.isAccepted()) { //once this happens the events before are pitched
1715  qt_button_down = 0;
1716  qt_mac_dblclick.last_widget = 0;
1717  }
1718  } else {
1719  handled_event = false;
1720  }
1721  }
1722  } else {
1723  handled_event = false;
1724  }
1725  break;
1726  case kEventClassTablet:
1727  switch (ekind) {
1728  case kEventTabletProximity:
1729  // Get the current point of the device and its unique ID.
1730  ::TabletProximityRec proxRec;
1731  GetEventParameter(event, kEventParamTabletProximityRec, typeTabletProximityRec, 0,
1732  sizeof(proxRec), 0, &proxRec);
1734  }
1735  break;
1736  case kEventClassMouse:
1737  {
1738  static const int kEventParamQAppSeenMouseEvent = 'QASM';
1739  // Check if we've seen the event, if we have we shouldn't process
1740  // it again as it may lead to spurious "double events"
1741  bool seenEvent;
1742  if (GetEventParameter(event, kEventParamQAppSeenMouseEvent,
1743  typeBoolean, 0, sizeof(bool), 0, &seenEvent) == noErr) {
1744  if (seenEvent)
1745  return eventNotHandledErr;
1746  }
1747  seenEvent = true;
1748  SetEventParameter(event, kEventParamQAppSeenMouseEvent, typeBoolean,
1749  sizeof(bool), &seenEvent);
1750 
1751  Point where;
1752  bool inNonClientArea = false;
1753  GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, 0,
1754  sizeof(where), 0, &where);
1755 #if defined(DEBUG_MOUSE_MAPS)
1756  const char *edesc = 0;
1757  switch(ekind) {
1758  case kEventMouseDown: edesc = "MouseButtonPress"; break;
1759  case kEventMouseUp: edesc = "MouseButtonRelease"; break;
1760  case kEventMouseDragged: case kEventMouseMoved: edesc = "MouseMove"; break;
1761  case kEventMouseScroll: edesc = "MouseWheelScroll"; break;
1762  case kEventMouseWheelMoved: edesc = "MouseWheelMove"; break;
1763  }
1764  if(ekind == kEventMouseDown || ekind == kEventMouseUp)
1765  qDebug("Handling mouse: %s", edesc);
1766 #endif
1767  QEvent::Type etype = QEvent::None;
1768  Qt::KeyboardModifiers modifiers;
1769  {
1770  UInt32 mac_modifiers = 0;
1771  GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, 0,
1772  sizeof(mac_modifiers), 0, &mac_modifiers);
1773  modifiers = qt_mac_get_modifiers(mac_modifiers);
1774  }
1775  Qt::MouseButtons buttons;
1776  {
1777  UInt32 mac_buttons = 0;
1778  GetEventParameter(event, kEventParamMouseChord, typeUInt32, 0,
1779  sizeof(mac_buttons), 0, &mac_buttons);
1780  if (ekind != kEventMouseWheelMoved)
1781  buttons = qt_mac_get_buttons(mac_buttons);
1782  else
1783  buttons = QApplication::mouseButtons();
1784  }
1785 
1786  int wheel_deltaX = 0;
1787  int wheel_deltaY = 0;
1788  static EventRef compatibilityEvent = 0;
1789 
1790  if (ekind == kEventMouseScroll) {
1791  // kEventMouseScroll is the new way of dealing with mouse wheel
1792  // events (kEventMouseWheelMoved was the old). kEventMouseScroll results
1793  // in much smoother scrolling when using Mighty Mouse or TrackPad. For
1794  // compatibility with older applications, carbon will also send us
1795  // kEventMouseWheelMoved events if we dont eat this event
1796  // (actually two events; one for horizontal and one for vertical).
1797  // As a results of this, and to make sure we dont't receive duplicate events,
1798  // we try to detect when this happend by checking the 'compatibilityEvent'.
1799  // Since delta is delivered as pixels rather than degrees, we need to
1800  // convert from pixels to degrees in a sensible manner.
1801  // It looks like 1/4 degrees per pixel behaves most native.
1802  // (NB: Qt expects the unit for delta to be 8 per degree):
1803  const int pixelsToDegrees = 2;
1804  SInt32 mdelt = 0;
1805  GetEventParameter(event, kEventParamMouseWheelSmoothHorizontalDelta, typeSInt32, 0,
1806  sizeof(mdelt), 0, &mdelt);
1807  wheel_deltaX = mdelt * pixelsToDegrees;
1808  mdelt = 0;
1809  GetEventParameter(event, kEventParamMouseWheelSmoothVerticalDelta, typeSInt32, 0,
1810  sizeof(mdelt), 0, &mdelt);
1811  wheel_deltaY = mdelt * pixelsToDegrees;
1812  GetEventParameter(event, kEventParamEventRef, typeEventRef, 0,
1813  sizeof(compatibilityEvent), 0, &compatibilityEvent);
1814  } else if (ekind == kEventMouseWheelMoved) {
1815  if (event != compatibilityEvent) {
1816  compatibilityEvent = 0;
1817  int mdelt = 0;
1818  GetEventParameter(event, kEventParamMouseWheelDelta, typeSInt32, 0,
1819  sizeof(mdelt), 0, &mdelt);
1820  EventMouseWheelAxis axis;
1821  GetEventParameter(event, kEventParamMouseWheelAxis, typeMouseWheelAxis, 0,
1822  sizeof(axis), 0, &axis);
1823 
1824  // Remove acceleration, and use either -120 or 120 as delta:
1825  if (axis == kEventMouseWheelAxisX)
1826  wheel_deltaX = qBound(-120, int(mdelt * 10000), 120);
1827  else
1828  wheel_deltaY = qBound(-120, int(mdelt * 10000), 120);
1829  }
1830  }
1831 
1832  Qt::MouseButton button = Qt::NoButton;
1833  if(ekind == kEventMouseDown || ekind == kEventMouseUp) {
1834  EventMouseButton mac_button = 0;
1835  GetEventParameter(event, kEventParamMouseButton, typeMouseButton, 0,
1836  sizeof(mac_button), 0, &mac_button);
1837  button = qt_mac_get_button(mac_button);
1838  }
1839 
1840  switch(ekind) {
1841  case kEventMouseDown:
1842  etype = QEvent::MouseButtonPress;
1843  break;
1844  case kEventMouseUp:
1846  break;
1847  case kEventMouseDragged:
1848  case kEventMouseMoved:
1849  etype = QEvent::MouseMove;
1850  break;
1851  }
1852 
1853  const bool inPopupMode = app->d_func()->inPopupMode();
1854 
1855  // A click outside a popup closes the popup. Make sure
1856  // that no events are generated for the release part of that click.
1857  // (The press goes to the popup and closes it.)
1858  if (etype == QEvent::MouseButtonPress) {
1860  } else if (qt_mac_previous_press_in_popup_mode && !inPopupMode && etype == QEvent::MouseButtonRelease) {
1862  handled_event = true;
1863 #if defined(DEBUG_MOUSE_MAPS)
1864  qDebug("Bail out early due to qt_mac_previous_press_in_popup_mode");
1865 #endif
1866  break; // break from case kEventClassMouse
1867  }
1868 
1869  //figure out which widget to send it to
1870  if(inPopupMode) {
1871  QWidget *popup = qApp->activePopupWidget();
1872  if (qt_button_down && qt_button_down->window() == popup) {
1873  widget = qt_button_down;
1874  } else {
1875  QPoint pos = popup->mapFromGlobal(QPoint(where.h, where.v));
1876  widget = popup->childAt(pos);
1877  }
1878  if(!widget)
1879  widget = popup;
1880  } else {
1881  if(mac_mouse_grabber) {
1882  widget = mac_mouse_grabber;
1883  } else if (qt_button_down) {
1884  widget = qt_button_down;
1885  } else {
1886  {
1887  WindowPtr window = 0;
1888  if(GetEventParameter(event, kEventParamWindowRef, typeWindowRef, 0,
1889  sizeof(window), 0, &window) != noErr)
1890  FindWindowOfClass(&where, kAllWindowClasses, &window, 0);
1891  if(window) {
1892  HIViewRef hiview;
1893  if(HIViewGetViewForMouseEvent(HIViewGetRoot(window), event, &hiview) == noErr) {
1894  widget = QWidget::find((WId)hiview);
1895  if (widget) {
1896  // Make sure we didn't pass over a widget with a "fake hole" in it.
1897  QWidget *otherWidget = QApplication::widgetAt(where.h, where.v);
1898  if (otherWidget && otherWidget->testAttribute(Qt::WA_MouseNoMask))
1899  widget = otherWidget;
1900  }
1901  }
1902  }
1903  }
1904  if(!widget) //fallback
1905  widget = QApplication::widgetAt(where.h, where.v);
1906  if(ekind == kEventMouseUp && widget) {
1907  short part = qt_mac_window_at(where.h, where.v);
1908  if(part == inDrag) {
1909  UInt32 count = 0;
1910  GetEventParameter(event, kEventParamClickCount, typeUInt32, NULL,
1911  sizeof(count), NULL, &count);
1912  if(count == 2 && qt_mac_collapse_on_dblclick) {
1913  if (widget->macEvent(er, event))
1914  return noErr;
1915  widget->setWindowState(widget->windowState() | Qt::WindowMinimized);
1916  //we send a hide to be like X11/Windows
1917  QEvent e(QEvent::Hide);
1919  break;
1920  }
1921  }
1922  }
1923  }
1924  }
1925  if (widget && widget->macEvent(er, event))
1926  return noErr;
1927  WindowPartCode wpc = qt_mac_window_at(where.h, where.v, 0);
1928  if (wpc == inProxyIcon && modifiers == Qt::ControlModifier && buttons != Qt::NoButton) {
1929  QIconDragEvent e;
1931  if (e.isAccepted()) {
1932  return noErr; // IconDrag ate it.
1933  }
1934  }
1935  if (inPopupMode == false
1936  && (qt_button_down == 0 || qt_button_down_in_content == false)
1937  && (wpc != inContent && wpc != inStructure)) {
1938  inNonClientArea = true;
1939  switch (etype) {
1940  case QEvent::MouseButtonPress: {
1941  UInt32 count = 0;
1942  GetEventParameter(event, kEventParamClickCount, typeUInt32, 0,
1943  sizeof(count), 0, &count);
1944  if(count % 2 || count == 0) {
1946  } else {
1948  }} break;
1951  break;
1952  case QEvent::MouseMove:
1953  if (widget == 0 || widget->hasMouseTracking())
1955  break;
1956  default:
1957  break;
1958  }
1959  }
1960 
1961  if(qt_mac_find_window((FrontWindow()))) { //set the cursor up
1962  QCursor cursor(Qt::ArrowCursor);
1963  QWidget *cursor_widget = widget;
1964  if(cursor_widget && cursor_widget == qt_button_down && ekind == kEventMouseUp)
1965  cursor_widget = QApplication::widgetAt(where.h, where.v);
1966  if(cursor_widget) { //only over the app, do we set a cursor..
1967  if(!qApp->d_func()->cursor_list.isEmpty()) {
1968  cursor = qApp->d_func()->cursor_list.first();
1969  } else {
1970  for(; cursor_widget; cursor_widget = cursor_widget->parentWidget()) {
1971  QWExtra *extra = cursor_widget->d_func()->extraData();
1972  if(extra && extra->curs && cursor_widget->isEnabled()) {
1973  cursor = *extra->curs;
1974  break;
1975  }
1976  }
1977  }
1978  }
1979  qt_mac_set_cursor(&cursor);
1980  }
1981 
1982  //This mouse button state stuff looks like this on purpose
1983  //although it looks hacky it is VERY intentional..
1984  if(widget && app_do_modal && !qt_try_modal(widget, event)) {
1985  if(ekind == kEventMouseDown && qt_mac_is_macsheet(QApplication::activeModalWidget()))
1986  QApplication::activeModalWidget()->parentWidget()->activateWindow(); //sheets have a parent
1987  handled_event = false;
1988 #if defined(DEBUG_MOUSE_MAPS)
1989  qDebug("Bail out early due to qt_try_modal");
1990 #endif
1991  break;
1992  }
1993 
1994  UInt32 tabletEventType = 0;
1995  GetEventParameter(event, kEventParamTabletEventType, typeUInt32, 0,
1996  sizeof(tabletEventType), 0, &tabletEventType);
1997  if (tabletEventType == kEventTabletPoint) {
1998  TabletPointRec tabletPointRec;
1999  GetEventParameter(event, kEventParamTabletPointRec, typeTabletPointRec, 0,
2000  sizeof(tabletPointRec), 0, &tabletPointRec);
2001  QEvent::Type t = QEvent::TabletMove; //default
2002  int new_tablet_button_state = tabletPointRec.buttons ? 1 : 0;
2003  if (new_tablet_button_state != tablet_button_state)
2004  if (new_tablet_button_state)
2005  t = QEvent::TabletPress;
2006  else
2008  tablet_button_state = new_tablet_button_state;
2009 
2010  QMacTabletHash *tabletHash = qt_mac_tablet_hash();
2011  if (!tabletHash->contains(tabletPointRec.deviceID) && t != QEvent::TabletRelease) {
2012  // Never discard TabletRelease events as they may be delivered *after* TabletLeaveProximity events
2013  qWarning("handleTabletEvent: This tablet device is unknown"
2014  " (received no proximity event for it). Discarding event.");
2015  return false;
2016  }
2017  QTabletDeviceData &deviceData = tabletHash->operator[](tabletPointRec.deviceID);
2018  if (t == QEvent::TabletPress) {
2019  deviceData.widgetToGetPress = widget;
2020  } else if (t == QEvent::TabletRelease && deviceData.widgetToGetPress) {
2021  widget = deviceData.widgetToGetPress;
2022  deviceData.widgetToGetPress = 0;
2023  }
2024 
2025  if (widget) {
2026  int tiltX = ((int)tabletPointRec.tiltX)/(32767/64); // 32K -> 60
2027  int tiltY = ((int)tabletPointRec.tiltY)/(-32767/64); // 32K -> 60
2028  HIPoint hiPoint;
2029  GetEventParameter(event, kEventParamMouseLocation, typeHIPoint, 0, sizeof(HIPoint), 0, &hiPoint);
2030  QPointF hiRes(hiPoint.x, hiPoint.y);
2031  QPoint global(where.h, where.v);
2032 
2033 
2034 
2035  QPoint local(widget->mapFromGlobal(global));
2036  int z = 0;
2037  qreal rotation = 0.0;
2038  qreal tp = 0.0;
2039  // Again from the Wacom.h header
2040 
2041  if (deviceData.capabilityMask & 0x0200) // Z-axis
2042  z = tabletPointRec.absZ;
2043 
2044  if (deviceData.capabilityMask & 0x0800) // Tangential pressure
2045  tp = tabletPointRec.tangentialPressure / 32767.0;
2046 
2047  if (deviceData.capabilityMask & 0x2000) // Rotation
2048  rotation = qreal(tabletPointRec.rotation) / 64.0;
2049 
2050  QTabletEvent e(t, local, global, hiRes, deviceData.tabletDeviceType,
2051  deviceData.tabletPointerType,
2052  qreal(tabletPointRec.pressure / qreal(0xffff)), tiltX, tiltY,
2053  tp, rotation, z, modifiers, deviceData.tabletUniqueID);
2055  if (e.isAccepted()) {
2056  if (t == QEvent::TabletPress) {
2058  } else if (t == QEvent::TabletRelease) {
2059  qt_button_down = 0;
2060  }
2061 #if defined(DEBUG_MOUSE_MAPS)
2062  qDebug("Bail out early due to tablet acceptance");
2063 #endif
2064  break;
2065  }
2066  }
2067  }
2068 
2069  if(ekind == kEventMouseDown) {
2071  const short windowPart = qt_mac_window_at(where.h, where.v, 0);
2072  // Menubar almost always wins.
2073  if (!inPopupMode && windowPart == inMenuBar) {
2074  MenuSelect(where); //allow menu tracking
2075  return noErr;
2076  }
2077 
2078  if (widget && !(GetCurrentKeyModifiers() & cmdKey)) {
2079  extern bool qt_isGenuineQWidget(const QWidget *); // qwidget_mac.cpp
2080  QWidget *window = widget->window();
2081  bool genuineQtWidget = qt_isGenuineQWidget(widget); // the widget, not the window.
2082  window->raise();
2083 
2084  bool needActivate = (window->windowType() != Qt::Desktop)
2085  && (window->windowType() != Qt::Popup)
2086  && !qt_mac_is_macsheet(window);
2087  if (needActivate && (!window->isModal() && qobject_cast<QDockWidget *>(window)))
2088  needActivate = false;
2089 
2090  if (genuineQtWidget && needActivate)
2091  needActivate = !window->isActiveWindow()
2092  || !IsWindowActive(qt_mac_window_for(window));
2093 
2094  if (needActivate) {
2095  window->activateWindow();
2096  if (!qt_mac_can_clickThrough(widget)) {
2098  handled_event = false;
2099 #if defined(DEBUG_MOUSE_MAPS)
2100  qDebug("Bail out early due to qt_mac_canClickThrough %s::%s", widget->metaObject()->className(),
2101  widget->objectName().toLocal8Bit().constData());
2102 #endif
2103  break;
2104  }
2105  }
2106  }
2107 
2108  if(qt_mac_dblclick.last_widget &&
2109  qt_mac_dblclick.last_x != -1 && qt_mac_dblclick.last_y != -1 &&
2110  QRect(qt_mac_dblclick.last_x-2, qt_mac_dblclick.last_y-2, 4, 4).contains(QPoint(where.h, where.v))) {
2111  if(qt_mac_dblclick.use_qt_time_limit) {
2112  EventTime now = GetEventTime(event);
2113  if(qt_mac_dblclick.last_time != -2 && qt_mac_dblclick.last_widget == widget &&
2114  now - qt_mac_dblclick.last_time <= ((double)QApplicationPrivate::mouse_double_click_time)/1000 &&
2115  qt_mac_dblclick.last_button == button)
2117  } else {
2118  UInt32 count = 0;
2119  GetEventParameter(event, kEventParamClickCount, typeUInt32, 0,
2120  sizeof(count), 0, &count);
2121  if(!(count % 2) && qt_mac_dblclick.last_modifiers == modifiers &&
2122  qt_mac_dblclick.last_widget == widget && qt_mac_dblclick.last_button == button)
2124  }
2125  if(etype == QEvent::MouseButtonDblClick)
2126  qt_mac_dblclick.last_widget = 0;
2127  }
2128  if(etype != QEvent::MouseButtonDblClick) {
2129  qt_mac_dblclick.last_x = where.h;
2130  qt_mac_dblclick.last_y = where.v;
2131  } else {
2132  qt_mac_dblclick.last_x = qt_mac_dblclick.last_y = -1;
2133  }
2134  } else if(qt_mac_no_click_through_mode) {
2135  if(ekind == kEventMouseUp)
2137  handled_event = false;
2138 #if defined(DEBUG_MOUSE_MAPS)
2139  qDebug("Bail out early due to qt_mac_no_click_through_mode");
2140 #endif
2141  break;
2142  }
2143 
2145  switch(ekind) {
2146  case kEventMouseUp:
2147  if (!buttons) {
2148  if (!inPopupMode && !QWidget::mouseGrabber())
2149  leaveAfterRelease = qt_button_down;
2150  qt_button_down = 0;
2151  }
2152  break;
2153  case kEventMouseDown: {
2154  if (!qt_button_down)
2156  WindowPartCode wpc = qt_mac_window_at(where.h, where.v, 0);
2157  qt_button_down_in_content = (wpc == inContent || wpc == inStructure);
2158  break; }
2159  }
2160 
2161  // Check if we should send enter/leave events:
2162  switch(ekind) {
2163  case kEventMouseDragged:
2164  case kEventMouseMoved:
2165  case kEventMouseUp:
2166  case kEventMouseDown: {
2167  // If we are in popup mode, widget will point to the current popup no matter
2168  // where the mouse cursor is. In that case find out if the mouse cursor is
2169  // really over the popup in order to send correct enter / leave envents.
2170  QWidget * const enterLeaveWidget = (inPopupMode || ekind == kEventMouseUp) ?
2171  QApplication::widgetAt(where.h, where.v) : static_cast<QWidget*>(widget);
2172 
2173  if ((QWidget *) qt_last_mouse_receiver != enterLeaveWidget || inNonClientArea) {
2174 #ifdef DEBUG_MOUSE_MAPS
2175  qDebug("Entering: %p - %s (%s), Leaving %s (%s)", (QWidget*)enterLeaveWidget,
2176  enterLeaveWidget ? enterLeaveWidget->metaObject()->className() : "none",
2177  enterLeaveWidget ? enterLeaveWidget->objectName().toLocal8Bit().constData() : "",
2180 #endif
2181 
2182  QWidget * const mouseGrabber = QWidget::mouseGrabber();
2183 
2184  if (inPopupMode) {
2185  QWidget *enter = enterLeaveWidget;
2187  if (mouseGrabber) {
2188  QWidget * const popupWidget = qApp->activePopupWidget();
2189  if (leave == popupWidget)
2190  enter = mouseGrabber;
2191  if (enter == popupWidget)
2192  leave = mouseGrabber;
2193  if ((enter == mouseGrabber && leave == popupWidget)
2194  || (leave == mouseGrabber && enter == popupWidget)) {
2196  qt_last_mouse_receiver = enter;
2197  }
2198  } else {
2200  qt_last_mouse_receiver = enter;
2201  }
2202  } else if ((!qt_button_down || !qt_last_mouse_receiver) && !mouseGrabber && !leaveAfterRelease) {
2204  qt_last_mouse_receiver = enterLeaveWidget;
2205  }
2206  }
2207  break; }
2208  }
2209 
2210  if(widget) {
2211  QPoint p(where.h, where.v);
2212  QPoint plocal(widget->mapFromGlobal(p));
2213  if(etype == QEvent::MouseButtonPress) {
2214  qt_mac_dblclick.last_widget = widget;
2215  qt_mac_dblclick.last_modifiers = modifiers;
2216  qt_mac_dblclick.last_button = button;
2217  qt_mac_dblclick.last_time = GetEventTime(event);
2218  }
2219 
2220  if (wheel_deltaX || wheel_deltaY) {
2221 #ifndef QT_NO_WHEELEVENT
2222  if (wheel_deltaX) {
2223  QWheelEvent qwe(plocal, p, wheel_deltaX, buttons, modifiers, Qt::Horizontal);
2224  QApplication::sendSpontaneousEvent(widget, &qwe);
2226  QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(p), p,
2227  wheel_deltaX, buttons, modifiers, Qt::Horizontal);
2229  if (!qwe2.isAccepted())
2230  handled_event = false;
2231  }
2232  }
2233  if (wheel_deltaY) {
2234  QWheelEvent qwe(plocal, p, wheel_deltaY, buttons, modifiers, Qt::Vertical);
2235  QApplication::sendSpontaneousEvent(widget, &qwe);
2237  QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(p), p,
2238  wheel_deltaY, buttons, modifiers, Qt::Vertical);
2240  if (!qwe2.isAccepted())
2241  handled_event = false;
2242  }
2243  }
2244 #endif // QT_NO_WHEELEVENT
2245  } else {
2246 #ifdef QMAC_SPEAK_TO_ME
2247  const int speak_keys = Qt::AltModifier | Qt::ShiftModifier;
2248  if(etype == QMouseEvent::MouseButtonDblClick && ((modifiers & speak_keys) == speak_keys)) {
2249  QVariant v = widget->property("displayText");
2250  if(!v.isValid()) v = widget->property("text");
2251  if(!v.isValid()) v = widget->property("windowTitle");
2252  if(v.isValid()) {
2253  QString s = v.toString();
2254  s.replace(QRegExp(QString::fromLatin1("(\\&|\\<[^\\>]*\\>)")), QLatin1String(""));
2255  SpeechChannel ch;
2256  NewSpeechChannel(0, &ch);
2257  SpeakText(ch, s.toLatin1().constData(), s.length());
2258  DisposeSpeechChannel(ch);
2259  }
2260  }
2261 #endif
2262  Qt::MouseButton buttonToSend = button;
2263  static bool lastButtonTranslated = false;
2264  if(ekind == kEventMouseDown &&
2265  button == Qt::LeftButton && (modifiers & Qt::MetaModifier)) {
2266  buttonToSend = Qt::RightButton;
2267  lastButtonTranslated = true;
2268  } else if(ekind == kEventMouseUp && lastButtonTranslated) {
2269  buttonToSend = Qt::RightButton;
2270  lastButtonTranslated = false;
2271  }
2272  QMouseEvent qme(etype, plocal, p, buttonToSend, buttons, modifiers);
2273  QApplication::sendSpontaneousEvent(widget, &qme);
2274  if(!qme.isAccepted() || inNonClientArea)
2275  handled_event = false;
2276  }
2277 
2278  if (leaveAfterRelease) {
2279  QWidget *enter = QApplication::widgetAt(where.h, where.v);
2280  QApplicationPrivate::dispatchEnterLeave(enter, leaveAfterRelease);
2281  qt_last_mouse_receiver = enter;
2282  leaveAfterRelease = 0;
2283  }
2284 
2285  if(ekind == kEventMouseDown &&
2286  ((button == Qt::RightButton) ||
2287  (button == Qt::LeftButton && (modifiers & Qt::MetaModifier))))
2289 
2290 #ifdef DEBUG_MOUSE_MAPS
2291  const char *event_desc = edesc;
2292  if(etype == QEvent::MouseButtonDblClick)
2293  event_desc = "Double Click";
2294  else if(etype == QEvent::NonClientAreaMouseButtonPress)
2295  event_desc = "NonClientMousePress";
2296  else if(etype == QEvent::NonClientAreaMouseButtonRelease)
2297  event_desc = "NonClientMouseRelease";
2298  else if(etype == QEvent::NonClientAreaMouseMove)
2299  event_desc = "NonClientMouseMove";
2301  event_desc = "NonClientMouseDblClick";
2302  qDebug("%d %d (%d %d) - Would send (%s) event to %p %s %s (%d 0x%08x 0x%08x %d)", p.x(), p.y(),
2303  plocal.x(), plocal.y(), event_desc, (QWidget*)widget,
2304  widget ? widget->objectName().toLocal8Bit().constData() : "*Unknown*",
2305  widget ? widget->metaObject()->className() : "*Unknown*",
2306  button, (int)buttons, (int)modifiers, wheel_deltaX);
2307 #endif
2308  } else {
2309  handled_event = false;
2310  }
2311  break;
2312  }
2313  case kEventClassTextInput:
2314  case kEventClassKeyboard: {
2315  EventRef key_event = event;
2316  if(eclass == kEventClassTextInput) {
2317  Q_ASSERT(ekind == kEventTextInputUnicodeForKeyEvent);
2318  OSStatus err = GetEventParameter(event, kEventParamTextInputSendKeyboardEvent, typeEventRef, 0,
2319  sizeof(key_event), 0, &key_event);
2320  Q_ASSERT(err == noErr);
2321  Q_UNUSED(err);
2322  }
2323  const UInt32 key_ekind = GetEventKind(key_event);
2324  Q_ASSERT(GetEventClass(key_event) == kEventClassKeyboard);
2325 
2326  if(key_ekind == kEventRawKeyDown)
2327  qt_keymapper_private()->updateKeyMap(er, key_event, data);
2329  widget = mac_keyboard_grabber;
2330  else if (app->activePopupWidget())
2331  widget = (app->activePopupWidget()->focusWidget() ?
2332  app->activePopupWidget()->focusWidget() : app->activePopupWidget());
2333  else if(QApplication::focusWidget())
2334  widget = QApplication::focusWidget();
2335  else
2336  widget = app->activeWindow();
2337 
2338  if (widget) {
2339  if (widget->macEvent(er, event))
2340  return noErr;
2341  } else {
2342  // Darn, I need to update tho modifier state, even though
2343  // Qt itself isn't getting them, otherwise the keyboard state get inconsistent.
2344  if (key_ekind == kEventRawKeyModifiersChanged) {
2345  UInt32 modifiers = 0;
2346  GetEventParameter(key_event, kEventParamKeyModifiers, typeUInt32, 0,
2347  sizeof(modifiers), 0, &modifiers);
2348  extern void qt_mac_send_modifiers_changed(quint32 modifiers, QObject *object); // qkeymapper_mac.cpp
2349  // Just send it to the qApp for the time being.
2350  qt_mac_send_modifiers_changed(modifiers, qApp);
2351  }
2352  handled_event = false;
2353  break;
2354  }
2355 
2356  if(app_do_modal && !qt_try_modal(widget, key_event))
2357  break;
2358  if (eclass == kEventClassTextInput) {
2359  handled_event = false;
2360  } else {
2361  handled_event = qt_keymapper_private()->translateKeyEvent(widget, er, key_event, data,
2362  widget == mac_keyboard_grabber);
2363  }
2364  break; }
2365  case kEventClassWindow: {
2366  WindowRef wid = 0;
2367  GetEventParameter(event, kEventParamDirectObject, typeWindowRef, 0,
2368  sizeof(WindowRef), 0, &wid);
2369  widget = qt_mac_find_window(wid);
2370  if (widget && widget->macEvent(er, event))
2371  return noErr;
2372  if(ekind == kEventWindowActivated) {
2374  QEvent ev(QEvent::Style);
2376  }
2377 
2378  if(widget && app_do_modal && !qt_try_modal(widget, event))
2379  break;
2380 
2381  if(widget && widget->window()->isVisible()) {
2382  QWidget *tlw = widget->window();
2383  if(tlw->isWindow() && !(tlw->windowType() == Qt::Popup)
2384  && !qt_mac_is_macdrawer(tlw)
2385  && (!tlw->parentWidget() || tlw->isModal()
2386  || !(tlw->windowType() == Qt::Tool))) {
2387  bool just_send_event = false;
2388  {
2389  WindowActivationScope scope;
2390  if(GetWindowActivationScope((WindowRef)wid, &scope) == noErr &&
2391  scope == kWindowActivationScopeIndependent) {
2392  if(GetFrontWindowOfClass(kAllWindowClasses, true) != wid)
2393  just_send_event = true;
2394  }
2395  }
2396  if(just_send_event) {
2399  } else {
2400  app->setActiveWindow(tlw);
2401  }
2402  }
2404  }
2405  } else if(ekind == kEventWindowDeactivated) {
2406  if(widget && QApplicationPrivate::active_window == widget)
2407  app->setActiveWindow(0);
2408  } else {
2409  handled_event = false;
2410  }
2411  break; }
2412  case kEventClassApplication:
2413  if(ekind == kEventAppActivated) {
2416  if(qt_clipboard) { //manufacture an event so the clipboard can see if it has changed
2419  }
2420  if(app) {
2423  }
2424  if(!app->activeWindow()) {
2425  WindowPtr wp = ActiveNonFloatingWindow();
2426  if(QWidget *tmp_w = qt_mac_find_window(wp))
2427  app->setActiveWindow(tmp_w);
2428  }
2430  } else if(ekind == kEventAppDeactivated) {
2431  //qt_mac_no_click_through_mode = false;
2432  while(app->d_func()->inPopupMode())
2433  app->activePopupWidget()->close();
2434  if(app) {
2437  }
2438  app->setActiveWindow(0);
2439  } else if(ekind == kEventAppAvailableWindowBoundsChanged) {
2441  } else {
2442  handled_event = false;
2443  }
2444  break;
2445  case kAppearanceEventClass:
2446  if(ekind == kAEAppearanceChanged) {
2450  QEvent ev(QEvent::Style);
2452  }
2453  } else {
2454  handled_event = false;
2455  }
2456  break;
2457  case kEventClassAppleEvent:
2458  if(ekind == kEventAppleEvent) {
2459  EventRecord erec;
2460  if(!ConvertEventRefToEventRecord(event, &erec))
2461  qDebug("Qt: internal: WH0A, unexpected condition reached. %s:%d", __FILE__, __LINE__);
2462  else if(AEProcessAppleEvent(&erec) != noErr)
2463  handled_event = false;
2464  } else {
2465  handled_event = false;
2466  }
2467  break;
2468  case kEventClassCommand:
2469  if(ekind == kEventCommandProcess) {
2470  HICommand cmd;
2471  GetEventParameter(event, kEventParamDirectObject, typeHICommand,
2472  0, sizeof(cmd), 0, &cmd);
2473  handled_event = false;
2474  if(!cmd.menu.menuRef && GetApplicationDockTileMenu()) {
2475  EventRef copy = CopyEvent(event);
2476  HICommand copy_cmd;
2477  GetEventParameter(event, kEventParamDirectObject, typeHICommand,
2478  0, sizeof(copy_cmd), 0, &copy_cmd);
2479  copy_cmd.menu.menuRef = GetApplicationDockTileMenu();
2480  SetEventParameter(copy, kEventParamDirectObject, typeHICommand, sizeof(copy_cmd), &copy_cmd);
2481  if(SendEventToMenu(copy, copy_cmd.menu.menuRef) == noErr)
2482  handled_event = true;
2483  }
2484  if(!handled_event) {
2485  if(cmd.commandID == kHICommandQuit) {
2486  // Quitting the application is not Qt's responsibility if
2487  // used in a plugin or just embedded into a native application.
2488  // In that case, let the event pass down to the native apps event handler.
2490  handled_event = true;
2491  HiliteMenu(0);
2492  bool handle_quit = true;
2494  int visible = 0;
2496  for(int i = 0; i < tlws.size(); ++i) {
2497  if(tlws.at(i)->isVisible())
2498  ++visible;
2499  }
2500  handle_quit = (visible <= 1);
2501  }
2502  if(handle_quit) {
2503  QCloseEvent ev;
2505  if(ev.isAccepted())
2506  app->quit();
2507  } else {
2509  }
2510  }
2511  } else if(cmd.commandID == kHICommandSelectWindow) {
2512  if((GetCurrentKeyModifiers() & cmdKey))
2513  handled_event = true;
2514  } else if(cmd.commandID == kHICommandAbout) {
2516  HiliteMenu(0);
2517  handled_event = true;
2518  }
2519  }
2520  }
2521  break;
2522  }
2523 
2524 #ifdef DEBUG_EVENTS
2525  qDebug("%shandled event %c%c%c%c %d", handled_event ? "(*) " : "",
2526  char(eclass >> 24), char((eclass >> 16) & 255), char((eclass >> 8) & 255),
2527  char(eclass & 255), (int)ekind);
2528 #endif
2529  if(!handled_event) //let the event go through
2530  return eventNotHandledErr;
2531  return noErr; //we eat the event
2532 #else
2533  Q_UNUSED(er);
2534  Q_UNUSED(event);
2535  Q_UNUSED(data);
2536  return eventNotHandledErr;
2537 #endif
2538 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
bool isModal() const
Definition: qwidget.h:951
T qobject_cast(QObject *object)
Definition: qobject.h:375
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...
virtual bool macEvent(EventHandlerCallRef, EventRef)
This special event handler can be reimplemented in a subclass to receive native Macintosh events...
Definition: qwidget.cpp:9918
QPointer< QWidget > qt_last_mouse_receiver
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
QWidget * focusWidget() const
Returns the last child of this widget that setFocus had been called on.
Definition: qwidget.cpp:6863
unsigned long WId
Definition: qwindowdefs.h:119
bool inPopupMode() const
static void beep()
Sounds the bell, using the default volume and sound.
double qreal
Definition: qglobal.h:1193
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition: qcursor.h:89
EventRef event
QPointer< QWidget > widget
Qt::WindowStates windowState() const
Returns the current window state.
Definition: qwidget.cpp:3086
void setWindowState(Qt::WindowStates state)
Sets the window state to windowState.
Qt::MouseButton qt_mac_get_button(EventMouseButton button)
The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-l...
Definition: qdockwidget.h:60
bool isActiveWindow
whether this widget&#39;s window is the active window
Definition: qwidget.h:186
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
static short qt_mac_window_at(int x, int y, QWidget **w=0)
void qt_dispatchTabletProximityEvent(const ::TabletProximityRec &proxRec)
The QWheelEvent class contains parameters that describe a wheel event.
Definition: qevent.h:139
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition: qevent.h:396
struct OpaqueWindowPtr * WindowRef
QString & replace(int i, int len, QChar after)
Definition: qstring.cpp:2005
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
static QWidget * activeWindow()
Returns the application top-level window that has the keyboard input focus, or 0 if no application wi...
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
QCursor * curs
Definition: qwidget_p.h:254
void qt_mac_set_cursor(const QCursor *)
Definition: qcursor_mac.mm:108
static Qt::MouseButtons buttons
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
bool qt_isGenuineQWidget(const QWidget *window)
Definition: qwidget_mac.mm:473
static QWidget * active_window
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static struct @193 request_activate_pending
QClipboard * qt_clipboard
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
void updateKeyMap(const MSG &msg)
static EventRef request_showsheet_pending
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
Definition: qhash.h:872
static QDesktopWidgetImplementation * instance()
QPointer< QWidget > widgetToGetPress
bool qt_mac_can_clickThrough(const QWidget *)
Definition: qwidget_mac.mm:280
static QWidget * focus_widget
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
Q_CORE_EXPORT void qDebug(const char *,...)
static void quit()
Tells the application to exit with return code 0 (success).
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or 0 if there is no Qt widget there...
static bool qt_mac_collapse_on_dblclick
static void qt_event_request_context(QWidget *w=0, EventRef *where=0)
NSWindow * window
static QWidget * activeModalWidget()
Returns the active modal widget.
static void qt_mac_event_release(EventRef &event)
bool qt_mac_is_macdrawer(const QWidget *)
Definition: qwidget_mac.mm:306
bool isAccepted() const
Definition: qcoreevent.h:307
static struct @192 qt_mac_dblclick
static QWidget * mouseGrabber()
Returns the widget that is currently grabbing the mouse input.
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
QWidget * mac_mouse_grabber
Definition: qwidget_mac.mm:156
void raise()
Raises this widget to the top of the parent widget&#39;s stack.
Definition: qwidget.cpp:11901
#define qApp
static bool qt_mac_previous_press_in_popup_mode
QWidget * childAt(int x, int y) const
Returns the visible child widget at the position ({x}, {y}) in the widget&#39;s coordinate system...
Definition: qwidget.h:934
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
struct OpaqueControlRef * HIViewRef
static EventRef request_context_pending
static bool qt_mac_no_click_through_mode
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)
static int mouse_double_click_time
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
static int tablet_button_state
static QStyle * app_style
bool translateKeyEvent(QWidget *receiver, const MSG &msg, bool grab)
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
void qt_mac_update_os_settings()
signed long OSStatus
static void setActiveWindow(QWidget *act)
Sets the active window to the active widget in response to a system event.
static bool qt_button_down_in_content
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
Definition: qstring.cpp:4049
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
static EventRef request_menubarupdate_pending
struct OpaqueEventRef * EventRef
bool isEnabled() const
Definition: qwidget.h:948
The QTabletEvent class contains parameters that describe a Tablet event.
Definition: qevent.h:179
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
static QWidget * activePopupWidget()
Returns the active popup widget.
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
static bool isBlockedByModal(QWidget *widget)
Returns true if widget is blocked by a modal window.
QWidget * qt_mac_find_window(OSWindowRef)
Definition: qwidget_mac.mm:391
QWidget * qt_button_down
QMacTabletHash * qt_mac_tablet_hash()
bool hasMouseTracking() const
Definition: qwidget.h:993
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
virtual bool macEventFilter(EventHandlerCallRef, EventRef)
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
Definition: qglobal.h:1219
Qt::MouseButtons qt_mac_get_buttons(int buttons)
const UInt32 kEventClassQt
Definition: qt_mac_p.h:92
unsigned int quint32
Definition: qglobal.h:938
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
static bool desktopSettingsAware()
Returns true if Qt is set to use the system&#39;s standard colors, fonts, etc.
const char * className() const
Returns the class name.
Definition: qobjectdefs.h:491
QString objectName() const
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
static bool macUpdateMenuBar()
Definition: qmenu_mac.mm:2055
QWidget * mac_keyboard_grabber
Definition: qwidget_mac.mm:157
bool qt_mac_is_macsheet(const QWidget *)
Definition: qwidget_mac.mm:295
static void dispatchEnterLeave(QWidget *enter, QWidget *leave)
void activateWindow()
Sets the top-level widget containing this widget to be the active window.
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
Qt::KeyboardModifiers qt_mac_get_modifiers(int keys)
static EventRef request_window_change_pending
QKeyMapperPrivate * qt_keymapper_private()
Definition: qkeymapper.cpp:113
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
void qt_mac_send_modifiers_changed(quint32, QObject *)
bool close()
Closes this widget.
Definition: qwidget.cpp:8305
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
static bool testAttribute(Qt::ApplicationAttribute attribute)
Returns true if attribute attribute is set; otherwise returns false.
static bool app_do_modal
bool filterEvent(void *message, long *result)
Sends message through the event filter that was set by setEventFilter().
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
Definition: qvariant.h:485
The QIconDragEvent class indicates that a main icon drag has begun.
Definition: qevent.h:372
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
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...
Definition: qglobal.h:1729
The QCloseEvent class contains parameters that describe a close event.
Definition: qevent.h:364
static bool qt_try_modal(QWidget *widget, EventRef event)
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
Definition: qcursor_mac.mm:310
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
MouseButton
Definition: qnamespace.h:150

◆ graphicsSystem()

static QGraphicsSystem* QApplicationPrivate::graphicsSystem ( )
inlinestatic

◆ initialize()

void QApplicationPrivate::initialize ( )

Initializes the QApplication object, called from the constructors.

Definition at line 984 of file qapplication.cpp.

985 {
988 
989 #if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA)
990  // initialize the graphics system - on X11 this is initialized inside
991  // qt_init() in qapplication_x11.cpp because of several reasons.
992  // On QWS, the graphics system is set by the QScreen plugin.
993  // We don't use graphics systems in Qt QPA
995 #endif
996 
998  (void) QApplication::style(); // trigger creation of application style
999  // trigger registering of QVariant's GUI types
1001 #ifndef QT_NO_STATEMACHINE
1002  // trigger registering of QStateMachine's GUI types
1004 #endif
1005 
1006  is_app_running = true; // no longer starting up
1007 
1008  Q_Q(QApplication);
1009 #ifndef QT_NO_SESSIONMANAGER
1010  // connect to the session manager
1012 #endif
1013 
1014  if (qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0)
1015  q->setAttribute(Qt::AA_NativeWindows);
1016 
1017 #ifdef Q_WS_WINCE
1018 #ifdef QT_AUTO_MAXIMIZE_THRESHOLD
1019  autoMaximizeThreshold = QT_AUTO_MAXIMIZE_THRESHOLD;
1020 #else
1021  if (qt_wince_is_mobile())
1022  autoMaximizeThreshold = 50;
1023  else
1024  autoMaximizeThreshold = -1;
1025 #endif //QT_AUTO_MAXIMIZE_THRESHOLD
1026 #endif //Q_WS_WINCE
1027 
1028  // Set up which span functions should be used in raster engine...
1030  // and QImage conversion functions
1032 
1033 #ifndef QT_NO_WHEELEVENT
1035 #endif
1036 
1037 #ifdef Q_WS_S60
1038  q->setAttribute(Qt::AA_S60DisablePartialScreenInputMode);
1039 #endif
1040 
1041  if (qt_is_gui_used)
1043 }
QSet< QWidget * > QWidgetSet
Definition: qwindowdefs.h:151
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static int wheel_scroll_lines
void qInitDrawhelperAsm()
bool qt_wince_is_mobile()
static QStyle * style()
Returns the application&#39;s style object.
QSessionManager * session_manager
int qRegisterGuiStateMachine()
#define Q_Q(Class)
Definition: qglobal.h:2483
int qRegisterGuiVariant()
The QSessionManager class provides access to the session manager.
static QGraphicsSystem * create(const QString &)
static int toInt(const QByteArray &str)
Definition: generator.cpp:167
static QWidgetSet * allWidgets
Definition: qwidget_p.h:715
static QString graphics_system_name
QHash< WId, QWidget * > QWidgetMapper
Definition: qwindowdefs.h:148
QApplication::Type qt_appType
static QGraphicsSystem * graphics_system
static QWidgetMapper * mapper
Definition: qwidget_p.h:714
void qInitImageConversions()
Definition: qimage.cpp:3909
bool qt_is_gui_used
static int autoMaximizeThreshold

◆ initializeMultitouch()

void QApplicationPrivate::initializeMultitouch ( )

Definition at line 6001 of file qapplication.cpp.

6002 {
6005 
6007 }
QMap< int, QTouchEvent::TouchPoint > appCurrentTouchPoints
QMap< int, QWeakPointer< QWidget > > widgetForTouchPointId
void clear()
Removes all items from the map.
Definition: qmap.h:444

◆ initializeMultitouch_sys()

void QApplicationPrivate::initializeMultitouch_sys ( )

Definition at line 3170 of file qapplication_mac.mm.

Referenced by QSessionManager::cancel(), and QApplication::setArgs().

3171 { }

◆ initializeWidgetPaletteHash()

void QApplicationPrivate::initializeWidgetPaletteHash ( )
static

Definition at line 617 of file qapplication_mac.mm.

Referenced by qt_set_windows_color_resources(), and QApplication::setStyle().

618 {
619  { //setup the palette
620  struct PaletteMap {
621  inline PaletteMap(const char *qc, ThemeBrush a, ThemeBrush i) :
622  qt_class(qc), active(a), inactive(i) { }
623  const char *const qt_class;
624  ThemeBrush active, inactive;
625  } mac_widget_colors[] = {
626  PaletteMap("QToolButton", kThemeTextColorBevelButtonActive, kThemeTextColorBevelButtonInactive),
627  PaletteMap("QAbstractButton", kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
628  PaletteMap("QHeaderView", kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
629  PaletteMap("Q3Header", kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
630  PaletteMap("QComboBox", kThemeTextColorPopupButtonActive, kThemeTextColorPopupButtonInactive),
631  PaletteMap("QAbstractItemView", kThemeTextColorListView, kThemeTextColorDialogInactive),
632  PaletteMap("QMessageBoxLabel", kThemeTextColorAlertActive, kThemeTextColorAlertInactive),
633  PaletteMap("QTabBar", kThemeTextColorTabFrontActive, kThemeTextColorTabFrontInactive),
634  PaletteMap("QLabel", kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
635  PaletteMap("QGroupBox", kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
636  PaletteMap("QMenu", kThemeTextColorPopupLabelActive, kThemeTextColorPopupLabelInactive),
637  PaletteMap("QTextEdit", 0, 0),
638  PaletteMap("QTextControl", 0, 0),
639  PaletteMap("QLineEdit", 0, 0),
640  PaletteMap(0, 0, 0) };
641  QColor qc;
642  for(int i = 0; mac_widget_colors[i].qt_class; i++) {
643  QPalette pal;
644  if (mac_widget_colors[i].active != 0) {
645  qc = qcolorForThemeTextColor(mac_widget_colors[i].active);
649  qc = qcolorForThemeTextColor(mac_widget_colors[i].inactive);
656  }
657  if (!strcmp(mac_widget_colors[i].qt_class, "QMenu")) {
658  qc = qcolorForThemeTextColor(kThemeTextColorMenuItemActive);
660  qc = qcolorForThemeTextColor(kThemeTextColorMenuItemSelected);
662  qc = qcolorForThemeTextColor(kThemeTextColorMenuItemDisabled);
664  } else if (!strcmp(mac_widget_colors[i].qt_class, "QAbstractButton")
665  || !strcmp(mac_widget_colors[i].qt_class, "QHeaderView")
666  || !strcmp(mac_widget_colors[i].qt_class, "Q3Header")) { //special
673  } else if (!strcmp(mac_widget_colors[i].qt_class, "QAbstractItemView")) {
676  qc = qcolorForThemeTextColor(kThemeTextColorMenuItemSelected);
678 #if 1
683 #endif
684  } else if (!strcmp(mac_widget_colors[i].qt_class, "QTextEdit")
685  || !strcmp(mac_widget_colors[i].qt_class, "QTextControl")) {
690  } else if (!strcmp(mac_widget_colors[i].qt_class, "QLineEdit")) {
693  }
694 
695  bool set_palette = true;
697  if (!phash->isEmpty()) {
699  = phash->constFind(mac_widget_colors[i].qt_class);
700  if (it != phash->constEnd())
701  set_palette = (pal != *it);
702  }
703  if (set_palette) {
704  QApplication::setPalette(pal, mac_widget_colors[i].qt_class);
705 #ifdef DEBUG_PLATFORM_SETTINGS
706  qt_mac_debug_palette(pal, QApplication::palette(), QLatin1String("Palette for ") + QString::fromLatin1(mac_widget_colors[i].qt_class));
707 #endif
708  }
709  }
710  }
711 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
Definition: qhash.h:395
static void setPalette(const QPalette &, const char *className=0)
Changes the default application palette to palette.
#define it(className, varName)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
static QPalette palette()
Returns the application palette.
#define qt_mac_debug_palette(x, y, z)
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
Definition: qpalette.h:107
void setBrush(ColorRole cr, const QBrush &brush)
Sets the brush for the given color role to the specified brush for all groups in the palette...
Definition: qpalette.h:206
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Definition: qhash.h:297
const_iterator constFind(const Key &key) const
Returns an iterator pointing to the item with the key in the hash.
Definition: qhash.h:859
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
Definition: qpalette.cpp:874
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
#define kThemeBrushAlternatePrimaryHighlightColor
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
QColor qcolorForThemeTextColor(ThemeTextColor themeColor)
Definition: qt_mac.cpp:128
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...
Definition: qpalette.h:201
QColor qcolorForTheme(ThemeBrush brush)
Definition: qt_mac.cpp:110
PaletteHash * qt_app_palettes_hash()
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ inPopupMode()

bool QApplicationPrivate::inPopupMode ( ) const

Definition at line 5303 of file qapplication.cpp.

Referenced by onApplicationChangedActivation(), and qt_cleanup().

5304 {
5306 }
static QWidgetList * popupWidgets

◆ instance()

static QApplicationPrivate* QApplicationPrivate::instance ( )
inlinestatic

◆ isAlien()

bool QApplicationPrivate::isAlien ( QWidget widget)
inlinestaticprivate

Definition at line 529 of file qapplication.cpp.

530 {
531  if (!widget)
532  return false;
533 #if defined(Q_WS_QWS) || defined(Q_WS_QPA)
534  return !widget->isWindow()
535 # ifdef Q_BACKINGSTORE_SUBSURFACES
536  && !(widget->d_func()->maybeTopData() && widget->d_func()->maybeTopData()->windowSurface)
537 # endif
538  ;
539 #else
540  return !widget->internalWinId();
541 #endif
542 }
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
QWindowSurface * windowSurface() const
Returns the QWindowSurface this widget will be drawn into.
Definition: qwidget.cpp:12819
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244

◆ isBlockedByModal()

bool QApplicationPrivate::isBlockedByModal ( QWidget widget)
static

Returns true if widget is blocked by a modal window.

Warning
This function is not part of the public interface.

Definition at line 2960 of file qapplication.cpp.

Referenced by flipPoint(), QAxClientSite::qt_metacall(), qt_try_modal(), QWidget::setForegroundRole(), QWidget::setVisible(), and QETWidget::translateMouseEvent().

2961 {
2962  widget = widget->window();
2963  if (!modalState())
2964  return false;
2965  if (QApplication::activePopupWidget() == widget)
2966  return false;
2967 
2968  for (int i = 0; i < qt_modal_stack->size(); ++i) {
2969  QWidget *modalWidget = qt_modal_stack->at(i);
2970 
2971  {
2972  // check if the active modal widget is our widget or a parent of our widget
2973  QWidget *w = widget;
2974  while (w) {
2975  if (w == modalWidget)
2976  return false;
2977  w = w->parentWidget();
2978  }
2979 #ifdef Q_WS_WIN
2980  if ((widget->testAttribute(Qt::WA_WState_Created) || widget->data->winid)
2981  && (modalWidget->testAttribute(Qt::WA_WState_Created) || modalWidget->data->winid)
2982  && IsChild(modalWidget->data->winid, widget->data->winid))
2983  return false;
2984 #endif
2985  }
2986 
2987  Qt::WindowModality windowModality = modalWidget->windowModality();
2988  if (windowModality == Qt::NonModal) {
2989  // determine the modality type if it hasn't been set on the
2990  // modalWidget, this normally happens when waiting for a
2991  // native dialog. use WindowModal if we are the child of a
2992  // group leader; otherwise use ApplicationModal.
2993  QWidget *m = modalWidget;
2994  while (m && !m->testAttribute(Qt::WA_GroupLeader)) {
2995  m = m->parentWidget();
2996  if (m)
2997  m = m->window();
2998  }
2999  windowModality = (m && m->testAttribute(Qt::WA_GroupLeader))
3000  ? Qt::WindowModal
3002  }
3003 
3004  switch (windowModality) {
3005  case Qt::ApplicationModal:
3006  {
3007  QWidget *groupLeaderForWidget = widget;
3008  while (groupLeaderForWidget && !groupLeaderForWidget->testAttribute(Qt::WA_GroupLeader))
3009  groupLeaderForWidget = groupLeaderForWidget->parentWidget();
3010 
3011  if (groupLeaderForWidget) {
3012  // if \a widget has WA_GroupLeader, it can only be blocked by ApplicationModal children
3013  QWidget *m = modalWidget;
3014  while (m && m != groupLeaderForWidget && !m->testAttribute(Qt::WA_GroupLeader))
3015  m = m->parentWidget();
3016  if (m == groupLeaderForWidget)
3017  return true;
3018  } else if (modalWidget != widget) {
3019  return true;
3020  }
3021  break;
3022  }
3023  case Qt::WindowModal:
3024  {
3025  QWidget *w = widget;
3026  do {
3027  QWidget *m = modalWidget;
3028  do {
3029  if (m == w)
3030  return true;
3031  m = m->parentWidget();
3032  if (m)
3033  m = m->window();
3034  } while (m);
3035  w = w->parentWidget();
3036  if (w)
3037  w = w->window();
3038  } while (w);
3039  break;
3040  }
3041  default:
3042  Q_ASSERT_X(false, "QApplication", "internal error, a modal widget cannot be modeless");
3043  break;
3044  }
3045  }
3046  return false;
3047 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
QPointer< QWidget > widget
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QWidgetList * qt_modal_stack
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
Qt::WindowModality windowModality
which windows are blocked by the modal widget
Definition: qwidget.h:156
QWidgetData * data
Definition: qwidget.h:815
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
static QWidget * activePopupWidget()
Returns the active popup widget.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
WindowModality
Definition: qnamespace.h:1683
WId winid
Definition: qwidget.h:117

◆ leaveModal()

void QApplicationPrivate::leaveModal ( QWidget widget)
static
Warning
This function is not part of the public interface.

Definition at line 3074 of file qapplication.cpp.

Referenced by QWidget::destroy(), QWidgetPrivate::hide_helper(), QWidgetPrivate::isBackgroundInherited(), isServerProcess(), QPageSetupDialogPrivate::openCarbonPageLayout(), QPrintDialogPrivate::openCarbonPrintPanel(), QGtkStylePrivate::openDirectory(), QGtkStylePrivate::openFilename(), QGtkStylePrivate::openFilenames(), QPrintDialogPrivate::openWindowsPrintDialogModally(), QAxClientSite::qt_metacall(), qt_win_get_existing_directory(), qt_win_get_open_file_name(), qt_win_get_open_file_names(), qt_win_get_save_file_name(), QGtkStylePrivate::saveFilename(), and QWidget::setAttribute().

3075 {
3076  QSet<QWidget*> blocked;
3078  for (int i = 0; i < windows.count(); ++i) {
3079  QWidget *window = windows.at(i);
3080  if (window->windowType() != Qt::Tool && isBlockedByModal(window))
3081  blocked.insert(window);
3082  }
3083 
3084  leaveModal_sys(widget);
3085 
3086  windows = QApplication::topLevelWidgets();
3088  for (int i = 0; i < windows.count(); ++i) {
3089  QWidget *window = windows.at(i);
3090  if(blocked.contains(window) && window->windowType() != Qt::Tool && !isBlockedByModal(window))
3091  QApplication::sendEvent(window, &e);
3092  }
3093 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
NSWindow * window
bool contains(const T &value) const
Definition: qset.h:91
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
const_iterator insert(const T &value)
Definition: qset.h:179
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
static bool isBlockedByModal(QWidget *widget)
Returns true if widget is blocked by a modal window.
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
static void leaveModal_sys(QWidget *)
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56

◆ leaveModal_sys()

void QApplicationPrivate::leaveModal_sys ( QWidget widget)
static

Definition at line 1536 of file qapplication_mac.mm.

Referenced by qt_try_modal(), QtWndProc(), QApplication::qwsSetCustomColors(), and QApplication::x11EventFilter().

1537 {
1538  if (qt_modal_stack && qt_modal_stack->removeAll(widget)) {
1539 #ifdef DEBUG_MODAL_EVENTS
1540  qDebug("Leaving modal state with %s::%s::%p (%d)", widget->metaObject()->className(), widget->objectName().toLocal8Bit().constData(),
1542 #endif
1543  if (qt_modal_stack->isEmpty()) {
1544  delete qt_modal_stack;
1545  qt_modal_stack = 0;
1546  QPoint p(QCursor::pos());
1547  app_do_modal = false;
1548  QWidget* w = 0;
1549  if (QWidget *grabber = QWidget::mouseGrabber())
1550  w = grabber;
1551  else
1552  w = QApplication::widgetAt(p.x(), p.y());
1553  dispatchEnterLeave(w, qt_last_mouse_receiver); // send synthetic enter event
1555  }
1556 #ifdef QT_MAC_USE_COCOA
1557  if (!qt_mac_is_macsheet(widget))
1558  QEventDispatcherMacPrivate::endModalSession(widget);
1559 #endif
1560  }
1561 #ifdef DEBUG_MODAL_EVENTS
1562  else qDebug("Failure to remove %s::%s::%p -- %p", widget->metaObject()->className(), widget->objectName().toLocal8Bit().constData(), widget, qt_modal_stack);
1563 #endif
1564  app_do_modal = (qt_modal_stack != 0);
1565  if (!app_do_modal)
1567 }
QPointer< QWidget > qt_last_mouse_receiver
QPointer< QWidget > widget
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
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 QWidget * mouseGrabber()
Returns the widget that is currently grabbing the mouse input.
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
Definition: qstring.cpp:4049
QWidgetList * qt_modal_stack
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
const char * className() const
Returns the class name.
Definition: qobjectdefs.h:491
QString objectName() const
bool qt_mac_is_macsheet(const QWidget *)
Definition: qwidget_mac.mm:295
static void dispatchEnterLeave(QWidget *enter, QWidget *leave)
static bool app_do_modal
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
void qt_event_request_menubarupdate()
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
Definition: qcursor_mac.mm:310
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ maxWindowRect()

QRect QApplicationPrivate::maxWindowRect ( const QScreen screen) const
inline

Definition at line 519 of file qapplication_p.h.

Referenced by QWSServerPrivate::_q_newConnection(), QWSServer::setMaxWindowRect(), and setScreenTransformation().

519 { return maxWindowRects[screen]; }
QMap< const QScreen *, QRect > maxWindowRects

◆ modalState()

bool QApplicationPrivate::modalState ( )
static

◆ notify_helper()

bool QApplicationPrivate::notify_helper ( QObject receiver,
QEvent e 
)

Definition at line 4635 of file qapplication.cpp.

4636 {
4637  // send to all application event filters
4638  if (sendThroughApplicationEventFilters(receiver, e))
4639  return true;
4640 
4641  if (receiver->isWidgetType()) {
4642  QWidget *widget = static_cast<QWidget *>(receiver);
4643 
4644 #if !defined(Q_WS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR))
4645  // toggle HasMouse widget state on enter and leave
4646  if ((e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) &&
4648  widget->setAttribute(Qt::WA_UnderMouse, true);
4649  else if (e->type() == QEvent::Leave || e->type() == QEvent::DragLeave)
4650  widget->setAttribute(Qt::WA_UnderMouse, false);
4651 #endif
4652 
4653  if (QLayout *layout=widget->d_func()->layout) {
4654  layout->widgetEvent(e);
4655  }
4656  }
4657 
4658  // send to all receiver event filters
4659  if (sendThroughObjectEventFilters(receiver, e))
4660  return true;
4661 
4662  // deliver the event
4663  bool consumed = receiver->event(e);
4664  e->spont = false;
4665  return consumed;
4666 }
bool sendThroughApplicationEventFilters(QObject *, QEvent *)
QPointer< QWidget > widget
ushort spont
Definition: qcoreevent.h:320
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
The QLayout class is the base class of geometry managers.
Definition: qlayout.h:90
const char * layout
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
Definition: qobject.h:146
static QWidget * activePopupWidget()
Returns the active popup widget.
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
QLayout * layout() const
Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed...
Definition: qwidget.cpp:10073
bool sendThroughObjectEventFilters(QObject *, QEvent *)
Type type() const
Returns the event type.
Definition: qcoreevent.h:303

◆ openPopup()

void QApplicationPrivate::openPopup ( QWidget popup)
Warning
This function is not part of the public interface.

Definition at line 2678 of file qapplication_mac.mm.

Referenced by qt_try_modal().

2679 {
2680  if (!QApplicationPrivate::popupWidgets) // create list
2682  QApplicationPrivate::popupWidgets->append(popup); // add to end of list
2683 
2684  // popups are not focus-handled by the window system (the first
2685  // popup grabbed the keyboard), so we have to do that manually: A
2686  // new popup gets the focus
2687  if (popup->focusWidget()) {
2689  } else if (QApplicationPrivate::popupWidgets->count() == 1) { // this was the first popup
2691  }
2692 }
QWidget * focusWidget() const
Returns the last child of this widget that setFocus had been called on.
Definition: qwidget.cpp:6863
QList< QWidget * > QWidgetList
Definition: qwindowdefs.h:89
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
static QWidgetList * popupWidgets
void setFocus()
Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its paren...
Definition: qwidget.h:432

◆ pickMouseReceiver()

QWidget * QApplicationPrivate::pickMouseReceiver ( QWidget candidate,
const QPoint globalPos,
QPoint pos,
QEvent::Type  type,
Qt::MouseButtons  buttons,
QWidget buttonDown,
QWidget alienWidget 
)
static

Definition at line 3124 of file qapplication.cpp.

Referenced by QETWidget::translateMouseEvent().

3128 {
3129  Q_ASSERT(candidate);
3130 
3131  QWidget *mouseGrabber = QWidget::mouseGrabber();
3133  && !buttonDown && !mouseGrabber) {
3134  return 0;
3135  }
3136 
3137  if (alienWidget && alienWidget->internalWinId())
3138  alienWidget = 0;
3139 
3140  QWidget *receiver = candidate;
3141 
3142  if (!mouseGrabber)
3143  mouseGrabber = (buttonDown && !isBlockedByModal(buttonDown)) ? buttonDown : alienWidget;
3144 
3145  if (mouseGrabber && mouseGrabber != candidate) {
3146  receiver = mouseGrabber;
3147  pos = receiver->mapFromGlobal(globalPos);
3148 #ifdef ALIEN_DEBUG
3149  qDebug() << " ** receiver adjusted to:" << receiver << "pos:" << pos;
3150 #endif
3151  }
3152 
3153  return receiver;
3154 
3155 }
int type
Definition: qmetatype.cpp:239
static Qt::MouseButtons buttons
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_CORE_EXPORT void qDebug(const char *,...)
static QWidget * mouseGrabber()
Returns the widget that is currently grabbing the mouse input.
static bool isBlockedByModal(QWidget *widget)
Returns true if widget is blocked by a modal window.
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.

◆ process_cmdline()

void QApplicationPrivate::process_cmdline ( )
Warning
This function is not part of the public interface.

Definition at line 569 of file qapplication.cpp.

570 {
571  // process platform-indep command line
572  if (!qt_is_gui_used || !argc)
573  return;
574 
575  int i, j;
576 
577  j = 1;
578  for (i=1; i<argc; i++) { // if you add anything here, modify QCoreApplication::arguments()
579  if (argv[i] && *argv[i] != '-') {
580  argv[j++] = argv[i];
581  continue;
582  }
583  QByteArray arg = argv[i];
584  arg = arg;
585  QString s;
586  if (arg == "-qdevel" || arg == "-qdebug") {
587  // obsolete argument
588  } else if (arg.indexOf("-style=", 0) != -1) {
589  s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower());
590  } else if (arg == "-style" && i < argc-1) {
591  s = QString::fromLocal8Bit(argv[++i]).toLower();
592 #ifndef QT_NO_SESSIONMANAGER
593  } else if (arg == "-session" && i < argc-1) {
594  ++i;
595  if (argv[i] && *argv[i]) {
597  int p = session_id.indexOf(QLatin1Char('_'));
598  if (p >= 0) {
599  session_key = session_id.mid(p +1);
601  }
602  is_session_restored = true;
603  }
604 #endif
605 #ifndef QT_NO_STYLE_STYLESHEET
606  } else if (arg == "-stylesheet" && i < argc -1) {
607  styleSheet = QLatin1String("file:///");
609  } else if (arg.indexOf("-stylesheet=") != -1) {
610  styleSheet = QLatin1String("file:///");
612 #endif
613  } else if (qstrcmp(arg, "-reverse") == 0) {
614  force_reverse = true;
616  } else if (qstrcmp(arg, "-widgetcount") == 0) {
617  widgetCount = true;
618  } else if (qstrcmp(arg, "-testability") == 0) {
619  load_testability = true;
620  } else if (arg == "-graphicssystem" && i < argc-1) {
622  } else {
623  argv[j++] = argv[i];
624  }
625  if (!s.isEmpty()) {
626  if (app_style) {
627  delete app_style;
628  app_style = 0;
629  }
630  styleOverride = s;
631  }
632  }
633 
634  if(j < argc) {
635  argv[j] = 0;
636  argc = j;
637  }
638 }
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
static bool force_reverse
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
QByteArray right(int len) const
Returns a byte array that contains the rightmost len bytes of this byte array.
static void setLayoutDirection(Qt::LayoutDirection direction)
static bool load_testability
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
static QStyle * app_style
int indexOf(char c, int from=0) const
Returns the index position of the first occurrence of the character ch in the byte array...
static QString graphics_system_name
int length() const
Same as size().
Definition: qbytearray.h:356
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...
Definition: qstring.cpp:3706
QString & append(QChar c)
Definition: qstring.cpp:1777
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
static QString styleSheet
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
Definition: qstring.cpp:5389
static QString styleOverride
int qstrcmp(const QByteArray &str1, const char *str2)
Definition: qbytearray.cpp:336
bool qt_is_gui_used
static bool widgetCount
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ qt_mac_apply_settings()

bool QApplicationPrivate::qt_mac_apply_settings ( )
static
Warning
This function is not part of the public interface.

Definition at line 2902 of file qapplication_mac.mm.

Referenced by qt_init().

2903 {
2904  QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
2905  settings.beginGroup(QLatin1String("Qt"));
2906 
2907  /*
2908  Qt settings. This is how they are written into the datastream.
2909  Palette/ * - QPalette
2910  font - QFont
2911  libraryPath - QStringList
2912  style - QString
2913  doubleClickInterval - int
2914  cursorFlashTime - int
2915  wheelScrollLines - int
2916  colorSpec - QString
2917  defaultCodec - QString
2918  globalStrut/width - int
2919  globalStrut/height - int
2920  GUIEffects - QStringList
2921  Font Substitutions/ * - QStringList
2922  Font Substitutions/... - QStringList
2923  */
2924 
2925  // read library (ie. plugin) path list
2926  QString libpathkey =
2927  QString::fromLatin1("%1.%2/libraryPath")
2928  .arg(QT_VERSION >> 16)
2929  .arg((QT_VERSION & 0xff00) >> 8);
2930  QStringList pathlist = settings.value(libpathkey).toString().split(QLatin1Char(':'));
2931  if (!pathlist.isEmpty()) {
2932  QStringList::ConstIterator it = pathlist.begin();
2933  while(it != pathlist.end())
2935  }
2936 
2937  QString defaultcodec = settings.value(QLatin1String("defaultCodec"), QVariant(QLatin1String("none"))).toString();
2938  if (defaultcodec != QLatin1String("none")) {
2940  if (codec)
2942  }
2943 
2944  if (qt_is_gui_used) {
2945  QString str;
2946  QStringList strlist;
2947  int num;
2948 
2949  // read new palette
2950  int i;
2952  strlist = settings.value(QLatin1String("Palette/active")).toStringList();
2953  if (strlist.count() == QPalette::NColorRoles) {
2954  for (i = 0; i < QPalette::NColorRoles; i++)
2955  pal.setColor(QPalette::Active, (QPalette::ColorRole) i,
2956  QColor(strlist[i]));
2957  }
2958  strlist = settings.value(QLatin1String("Palette/inactive")).toStringList();
2959  if (strlist.count() == QPalette::NColorRoles) {
2960  for (i = 0; i < QPalette::NColorRoles; i++)
2961  pal.setColor(QPalette::Inactive, (QPalette::ColorRole) i,
2962  QColor(strlist[i]));
2963  }
2964  strlist = settings.value(QLatin1String("Palette/disabled")).toStringList();
2965  if (strlist.count() == QPalette::NColorRoles) {
2966  for (i = 0; i < QPalette::NColorRoles; i++)
2967  pal.setColor(QPalette::Disabled, (QPalette::ColorRole) i,
2968  QColor(strlist[i]));
2969  }
2970 
2971  if (pal != QApplication::palette())
2973 
2974  // read new font
2975  QFont font(QApplication::font());
2976  str = settings.value(QLatin1String("font")).toString();
2977  if (!str.isEmpty()) {
2978  font.fromString(str);
2979  if (font != QApplication::font())
2980  QApplication::setFont(font);
2981  }
2982 
2983  // read new QStyle
2984  QString stylename = settings.value(QLatin1String("style")).toString();
2985  if (! stylename.isNull() && ! stylename.isEmpty()) {
2986  QStyle *style = QStyleFactory::create(stylename);
2987  if (style)
2988  QApplication::setStyle(style);
2989  else
2990  stylename = QLatin1String("default");
2991  } else {
2992  stylename = QLatin1String("default");
2993  }
2994 
2995  num = settings.value(QLatin1String("doubleClickInterval"),
2998 
2999  num = settings.value(QLatin1String("cursorFlashTime"),
3000  QApplication::cursorFlashTime()).toInt();
3002 
3003 #ifndef QT_NO_WHEELEVENT
3004  num = settings.value(QLatin1String("wheelScrollLines"),
3005  QApplication::wheelScrollLines()).toInt();
3007 #endif
3008 
3009  QString colorspec = settings.value(QLatin1String("colorSpec"),
3010  QVariant(QLatin1String("default"))).toString();
3011  if (colorspec == QLatin1String("normal"))
3013  else if (colorspec == QLatin1String("custom"))
3015  else if (colorspec == QLatin1String("many"))
3017  else if (colorspec != QLatin1String("default"))
3018  colorspec = QLatin1String("default");
3019 
3020  int w = settings.value(QLatin1String("globalStrut/width")).toInt();
3021  int h = settings.value(QLatin1String("globalStrut/height")).toInt();
3022  QSize strut(w, h);
3023  if (strut.isValid())
3025 
3026  QStringList effects = settings.value(QLatin1String("GUIEffects")).toStringList();
3027  if (!effects.isEmpty()) {
3028  if (effects.contains(QLatin1String("none")))
3030  if (effects.contains(QLatin1String("general")))
3032  if (effects.contains(QLatin1String("animatemenu")))
3034  if (effects.contains(QLatin1String("fademenu")))
3036  if (effects.contains(QLatin1String("animatecombo")))
3038  if (effects.contains(QLatin1String("animatetooltip")))
3040  if (effects.contains(QLatin1String("fadetooltip")))
3042  if (effects.contains(QLatin1String("animatetoolbox")))
3044  } else {
3046  }
3047 
3048  settings.beginGroup(QLatin1String("Font Substitutions"));
3049  QStringList fontsubs = settings.childKeys();
3050  if (!fontsubs.isEmpty()) {
3051  QStringList::Iterator it = fontsubs.begin();
3052  for (; it != fontsubs.end(); ++it) {
3053  QString fam = QString::fromLatin1((*it).toLatin1().constData());
3054  QStringList subs = settings.value(fam).toStringList();
3055  QFont::insertSubstitutions(fam, subs);
3056  }
3057  }
3058  settings.endGroup();
3059  }
3060 
3061  settings.endGroup();
3062  return true;
3063 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
static void setPalette(const QPalette &, const char *className=0)
Changes the default application palette to palette.
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
Definition: qpalette.h:93
static void setStyle(QStyle *)
Sets the application&#39;s GUI style to style.
#define it(className, varName)
The QSettings class provides persistent platform-independent application settings.
Definition: qsettings.h:73
static void addLibraryPath(const QString &)
Prepends path to the beginning of the library path list, ensuring that it is searched for libraries f...
static QStyle * create(const QString &)
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
Definition: qlist.h:267
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
static QPalette palette()
Returns the application palette.
static int cursorFlashTime()
The QString class provides a Unicode character string.
Definition: qstring.h:83
static int wheelScrollLines()
iterator Iterator
Qt-style synonym for QList::iterator.
Definition: qlist.h:278
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
static QFont font()
Returns the default application font.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:270
static void insertSubstitutions(const QString &, const QStringList &)
Inserts the list of families substituteNames into the substitution list for familyName.
Definition: qfont.cpp:2175
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
static QTextCodec * codec(MYSQL *mysql)
Definition: qsql_mysql.cpp:220
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
T value(int i) const
Returns the value at index position i in the list.
Definition: qlist.h:661
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition: qstring.h:505
static void setColorSpec(int)
Sets the color specification for the application to spec.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
static void setCursorFlashTime(int)
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
const_iterator ConstIterator
Qt-style synonym for QList::const_iterator.
Definition: qlist.h:279
static void setWheelScrollLines(int)
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
Definition: qstyle.h:68
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
bool qt_is_gui_used
static void setDoubleClickInterval(int)
The QTextCodec class provides conversions between text encodings.
Definition: qtextcodec.h:62
static void setFont(const QFont &, const char *className=0)
Changes the default application font to font.
static int doubleClickInterval()
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
static void setGlobalStrut(const QSize &)
static void setCodecForTr(QTextCodec *c)
Definition: qtextcodec.h:156
static void setEffectEnabled(Qt::UIEffect, bool enable=true)
Enables the UI effect effect if enable is true, otherwise the effect will not be used.
#define QT_VERSION
This macro expands a numeric value of the form 0xMMNNPP (MM = major, NN = minor, PP = patch) that spe...
Definition: qglobal.h:51
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ removeTouchPoint()

void QApplicationPrivate::removeTouchPoint ( int  touchPointId)

◆ reset_instance_pointer()

void QApplicationPrivate::reset_instance_pointer ( )
static
Warning
This function is not part of the public interface. Resets the QApplication::instance() pointer to zero

Definition at line 1086 of file qapplication_x11.cpp.

Referenced by qt_init(), and qt_xio_errhandler().

1087 { QApplication::self = 0; }
static QCoreApplication * self

◆ sendMouseEvent()

bool QApplicationPrivate::sendMouseEvent ( QWidget receiver,
QMouseEvent event,
QWidget alienWidget,
QWidget native,
QWidget **  buttonDown,
QPointer< QWidget > &  lastMouseReceiver,
bool  spontaneous = true 
)
static

Definition at line 3160 of file qapplication.cpp.

Referenced by flipPoint(), QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(), and QETWidget::translateMouseEvent().

3164 {
3165  Q_ASSERT(receiver);
3166  Q_ASSERT(event);
3167  Q_ASSERT(nativeWidget);
3168  Q_ASSERT(buttonDown);
3169 
3170  if (alienWidget && !isAlien(alienWidget))
3171  alienWidget = 0;
3172 
3173  QPointer<QWidget> receiverGuard = receiver;
3174  QPointer<QWidget> nativeGuard = nativeWidget;
3175  QPointer<QWidget> alienGuard = alienWidget;
3176  QPointer<QWidget> activePopupWidget = QApplication::activePopupWidget();
3177 
3178  const bool graphicsWidget = nativeWidget->testAttribute(Qt::WA_DontShowOnScreen);
3179 
3180  if (*buttonDown) {
3181  if (!graphicsWidget) {
3182  // Register the widget that shall receive a leave event
3183  // after the last button is released.
3184  if ((alienWidget || !receiver->internalWinId()) && !leaveAfterRelease && !QWidget::mouseGrabber())
3185  leaveAfterRelease = *buttonDown;
3186  if (event->type() == QEvent::MouseButtonRelease && !event->buttons())
3187  *buttonDown = 0;
3188  }
3189  } else if (lastMouseReceiver) {
3190  // Dispatch enter/leave if we move:
3191  // 1) from an alien widget to another alien widget or
3192  // from a native widget to an alien widget (first OR case)
3193  // 2) from an alien widget to a native widget (second OR case)
3194  if ((alienWidget && alienWidget != lastMouseReceiver)
3195  || (isAlien(lastMouseReceiver) && !alienWidget)) {
3196  if (activePopupWidget) {
3197  if (!QWidget::mouseGrabber())
3198  dispatchEnterLeave(alienWidget ? alienWidget : nativeWidget, lastMouseReceiver);
3199  } else {
3200  dispatchEnterLeave(receiver, lastMouseReceiver);
3201  }
3202 
3203  }
3204  }
3205 
3206 #ifdef ALIEN_DEBUG
3207  qDebug() << "QApplicationPrivate::sendMouseEvent: receiver:" << receiver
3208  << "pos:" << event->pos() << "alien" << alienWidget << "button down"
3209  << *buttonDown << "last" << lastMouseReceiver << "leave after release"
3210  << leaveAfterRelease;
3211 #endif
3212 
3213  // We need this quard in case someone opens a modal dialog / popup. If that's the case
3214  // leaveAfterRelease is set to null, but we shall not update lastMouseReceiver.
3215  const bool wasLeaveAfterRelease = leaveAfterRelease != 0;
3216  bool result;
3217  if (spontaneous)
3218  result = QApplication::sendSpontaneousEvent(receiver, event);
3219  else
3220  result = QApplication::sendEvent(receiver, event);
3221 
3222  if (!graphicsWidget && leaveAfterRelease && event->type() == QEvent::MouseButtonRelease
3223  && !event->buttons() && QWidget::mouseGrabber() != leaveAfterRelease) {
3224  // Dispatch enter/leave if:
3225  // 1) the mouse grabber is an alien widget
3226  // 2) the button is released on an alien widget
3227  QWidget *enter = 0;
3228  if (nativeGuard)
3229  enter = alienGuard ? alienWidget : nativeWidget;
3230  else // The receiver is typically deleted on mouse release with drag'n'drop.
3231  enter = QApplication::widgetAt(event->globalPos());
3232  dispatchEnterLeave(enter, leaveAfterRelease);
3233  leaveAfterRelease = 0;
3234  lastMouseReceiver = enter;
3235  } else if (!wasLeaveAfterRelease) {
3236  if (activePopupWidget) {
3237  if (!QWidget::mouseGrabber())
3238  lastMouseReceiver = alienGuard ? alienWidget : (nativeGuard ? nativeWidget : 0);
3239  } else {
3240  lastMouseReceiver = receiverGuard ? receiver : QApplication::widgetAt(event->globalPos());
3241  }
3242  }
3243 
3244  return result;
3245 }
static QPointer< QWidget > leaveAfterRelease
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
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 QWidget * mouseGrabber()
Returns the widget that is currently grabbing the mouse input.
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static QWidget * activePopupWidget()
Returns the active popup widget.
QPoint pos
the position of the widget within its parent widget
Definition: qwidget.h:163
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
static void dispatchEnterLeave(QWidget *enter, QWidget *leave)
static bool isAlien(QWidget *)
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
const QPoint & globalPos() const
Returns the global position of the mouse cursor at the time of the event.
Definition: qevent.h:96

◆ sendSyntheticEnterLeave()

void QApplicationPrivate::sendSyntheticEnterLeave ( QWidget widget)

Definition at line 3256 of file qapplication.cpp.

3257 {
3258 #ifndef QT_NO_CURSOR
3259 #if defined(Q_WS_QWS) || defined(Q_WS_QPA)
3260  if (!widget || widget->isWindow())
3261  return;
3262 #else
3263  if (!widget || widget->internalWinId() || widget->isWindow())
3264  return;
3265 #endif
3266  const bool widgetInShow = widget->isVisible() && !widget->data->in_destructor;
3267  if (!widgetInShow && widget != qt_last_mouse_receiver)
3268  return; // Widget was not under the cursor when it was hidden/deleted.
3269 
3270  if (widgetInShow && widget->parentWidget()->data->in_show)
3271  return; // Ingore recursive show.
3272 
3273  QWidget *mouseGrabber = QWidget::mouseGrabber();
3274  if (mouseGrabber && mouseGrabber != widget)
3275  return; // Someone else has the grab; enter/leave should not occur.
3276 
3277  QWidget *tlw = widget->window();
3278  if (tlw->data->in_destructor || tlw->data->is_closing)
3279  return; // Closing down the business.
3280 
3281  if (widgetInShow && (!qt_last_mouse_receiver || qt_last_mouse_receiver->window() != tlw))
3282  return; // Mouse cursor not inside the widget's top-level.
3283 
3284  const QPoint globalPos(QCursor::pos());
3285  QPoint pos = tlw->mapFromGlobal(globalPos);
3286 
3287  // Find the current widget under the mouse. If this function was called from
3288  // the widget's destructor, we have to make sure childAt() doesn't take into
3289  // account widgets that are about to be destructed.
3290  QWidget *widgetUnderCursor = tlw->d_func()->childAt_helper(pos, widget->data->in_destructor);
3291  if (!widgetUnderCursor)
3292  widgetUnderCursor = tlw;
3293  else
3294  pos = widgetUnderCursor->mapFrom(tlw, pos);
3295 
3296  if (widgetInShow && widgetUnderCursor != widget && !widget->isAncestorOf(widgetUnderCursor))
3297  return; // Mouse cursor not inside the widget or any of its children.
3298 
3299  if (widget->data->in_destructor && qt_button_down == widget)
3300  qt_button_down = 0;
3301 
3302  // Send enter/leave events followed by a mouse move on the entered widget.
3304  sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver);
3305 #endif // QT_NO_CURSOR
3306 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
bool isVisible() const
Definition: qwidget.h:1005
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QPointer< QWidget > qt_last_mouse_receiver
static QWidget * mouseGrabber()
Returns the widget that is currently grabbing the mouse input.
QWidgetData * data
Definition: qwidget.h:815
uint is_closing
Definition: qwidget.h:123
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
bool isAncestorOf(const QWidget *child) const
Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child...
Definition: qwidget.cpp:8573
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
QWidget * qt_button_down
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
uint in_destructor
Definition: qwidget.h:129
QPoint mapFrom(QWidget *, const QPoint &) const
Translates the widget coordinate pos from the coordinate system of parent to this widget&#39;s coordinate...
Definition: qwidget.cpp:4433
static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget, QWidget *native, QWidget **buttonDown, QPointer< QWidget > &lastMouseReceiver, bool spontaneous=true)
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
Definition: qcursor_mac.mm:310
uint in_show
Definition: qwidget.h:124

◆ setFocusWidget()

void QApplicationPrivate::setFocusWidget ( QWidget focus,
Qt::FocusReason  reason 
)
static

Definition at line 2233 of file qapplication.cpp.

Referenced by QWidget::clearFocus(), make_widget_eventUPP(), QApplication::setActiveWindow(), and QWidget::setFocus().

2234 {
2235 #ifndef QT_NO_GRAPHICSVIEW
2236  if (focus && focus->window()->graphicsProxyWidget())
2237  return;
2238 #endif
2239 
2240  hidden_focus_widget = 0;
2241 
2242  if (focus != focus_widget) {
2243  if (focus && focus->isHidden()) {
2244  hidden_focus_widget = focus;
2245  return;
2246  }
2247 
2248  if (focus && (reason == Qt::BacktabFocusReason || reason == Qt::TabFocusReason)
2251  else if (focus && reason == Qt::ShortcutFocusReason) {
2253  }
2254  QWidget *prev = focus_widget;
2255  focus_widget = focus;
2256 #ifndef QT_NO_IM
2257  if (prev && ((reason != Qt::PopupFocusReason && reason != Qt::MenuBarFocusReason
2259  // Do reset the input context, in case the new focus widget won't accept keyboard input
2260  // or it is not created fully yet.
2263  QInputContext *qic = prev->inputContext();
2264  if(qic) {
2265  qic->reset();
2266  qic->setFocusWidget(0);
2267  }
2268  }
2269 #endif //QT_NO_IM
2270 
2271  if(focus_widget)
2272  focus_widget->d_func()->setFocus_sys();
2273 
2274  if (reason != Qt::NoFocusReason) {
2275 
2276  //send events
2277  if (prev) {
2278 #ifdef QT_KEYPAD_NAVIGATION
2279  if (QApplication::keypadNavigationEnabled()) {
2280  if (prev->hasEditFocus() && reason != Qt::PopupFocusReason
2281 #ifdef Q_OS_SYMBIAN
2282  && reason != Qt::ActiveWindowFocusReason
2283 #endif
2284  )
2285  prev->setEditFocus(false);
2286  }
2287 #endif
2288 #ifndef QT_NO_IM
2289  if (focus) {
2290  QInputContext *prevIc;
2291  prevIc = prev->inputContext();
2292  if (prevIc && prevIc != focus->inputContext()) {
2293  QEvent closeSIPEvent(QEvent::CloseSoftwareInputPanel);
2294  QApplication::sendEvent(prev, &closeSIPEvent);
2295  }
2296  }
2297 #endif
2298  QFocusEvent out(QEvent::FocusOut, reason);
2299  QPointer<QWidget> that = prev;
2300  QApplication::sendEvent(prev, &out);
2301  if (that)
2302  QApplication::sendEvent(that->style(), &out);
2303  }
2304  if(focus && QApplicationPrivate::focus_widget == focus) {
2305 #ifndef QT_NO_IM
2307  QInputContext *qic = focus->inputContext();
2308  if (qic && focus->testAttribute(Qt::WA_WState_Created)
2309  && focus->isEnabled())
2310  qic->setFocusWidget(focus);
2311  }
2312 #endif //QT_NO_IM
2313  QFocusEvent in(QEvent::FocusIn, reason);
2314  QPointer<QWidget> that = focus;
2315  QApplication::sendEvent(focus, &in);
2316  if (that)
2317  QApplication::sendEvent(that->style(), &in);
2318  }
2319  emit qApp->focusChanged(prev, focus_widget);
2320  }
2321  }
2322 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QGraphicsProxyWidget * graphicsProxyWidget() const
Returns the proxy widget for the corresponding embedded widget in a graphics view; otherwise returns ...
Definition: qwidget.cpp:12939
QStyle * style() const
Definition: qwidget.cpp:2742
static QWidget * focus_widget
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
#define qApp
#define emit
Definition: qobjectdefs.h:76
static QWidget * hidden_focus_widget
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QInputContext * inputContext()
This function returns the QInputContext for this widget.
Definition: qwidget.cpp:474
bool isEnabled() const
Definition: qwidget.h:948
virtual void reset()=0
This function can be reimplemented in a subclass to reset the state of the input method.
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
The QInputContext class abstracts the input method dependent data and composing state.
Definition: qinputcontext.h:83
bool qt_in_tab_key_event
virtual void setFocusWidget(QWidget *w)
Sets the widget that has an input focus for this input context.
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
The QFocusEvent class contains event parameters for widget focus events.
Definition: qevent.h:275

◆ setMaxWindowRect()

void QApplicationPrivate::setMaxWindowRect ( const QScreen screen,
int  screenNo,
const QRect rect 
)

Definition at line 243 of file qapplication_qws.cpp.

Referenced by QWSServer::endDisplayReconfigure(), QWSDisplay::Data::fillQueue(), QApplication::qwsProcessEvent(), setMaxWindowRect(), and QWSServer::setMaxWindowRect().

245 {
246  if (maxWindowRects.value(screen) == rect)
247  return;
248 
249  maxWindowRects[screen] = rect;
250 
251  // Re-resize any maximized windows
253  for (int i = 0; i < l.size(); ++i) {
254  QWidget *w = l.at(i);
255  QScreen *s = w->d_func()->getScreen();
256  if (s == screen) {
257  if (w->isMaximized())
258  w->d_func()->setMaxWindowState_helper();
259  else if (w->isFullScreen())
260  w->d_func()->setFullScreenSize_helper();
261  }
262  }
263 
264  if ( qt_desktopWidget ) // XXX workaround crash
266 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void workAreaResized(int)
const T value(const Key &key) const
Returns the value associated with the key key.
Definition: qmap.h:499
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
bool isMaximized() const
Definition: qwidget.cpp:3074
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
bool isFullScreen() const
Definition: qwidget.cpp:3153
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QMap< const QScreen *, QRect > maxWindowRects
QFactoryLoader * l
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QDesktopWidget * qt_desktopWidget

◆ setPalette_helper()

void QApplicationPrivate::setPalette_helper ( const QPalette palette,
const char *  className,
bool  clearWidgetPaletteHash 
)
static

Definition at line 1864 of file qapplication.cpp.

Referenced by QApplication::setPalette(), and QApplication::setStyle().

1865 {
1866  QPalette pal = palette;
1867 
1869  QApplicationPrivate::app_style->polish(pal); // NB: non-const reference
1870 
1871  bool all = false;
1872  PaletteHash *hash = app_palettes();
1873  if (!className) {
1875  return;
1878  else
1880  if (hash && hash->size()) {
1881  all = true;
1882  if (clearWidgetPaletteHash)
1883  hash->clear();
1884  }
1885  } else if (hash) {
1886  hash->insert(className, pal);
1887  }
1888 
1890  // Send ApplicationPaletteChange to qApp itself, and to the widgets.
1893 
1895  for (QWidgetList::ConstIterator it = wids.constBegin(); it != wids.constEnd(); ++it) {
1896  register QWidget *w = *it;
1897  if (all || (!className && w->isWindow()) || w->inherits(className)) // matching class
1898  QApplication::sendEvent(w, &e);
1899  }
1900 
1901  // Send to all scenes as well.
1902 #ifndef QT_NO_GRAPHICSVIEW
1903  QList<QGraphicsScene *> &scenes = qApp->d_func()->scene_list;
1905  it != scenes.constEnd(); ++it) {
1907  }
1908 #endif //QT_NO_GRAPHICSVIEW
1909  }
1912  QApplicationPrivate::set_pal = new QPalette(palette);
1913  else
1914  *QApplicationPrivate::set_pal = palette;
1915  }
1916 }
static uint hash(const uchar *p, int n)
Definition: qhash.cpp:68
static QWidgetList allWidgets()
Returns a list of all the widgets in the application.
void clear()
Removes all items from the hash.
Definition: qhash.h:574
#define it(className, varName)
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
static QPalette * set_pal
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
static QPalette * app_pal
const char * className
Definition: qwizard.cpp:137
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
bool isCopyOf(const QPalette &p) const
Returns true if this palette and p are copies of each other, i.e.
Definition: qpalette.cpp:1233
#define qApp
static QStyle * app_style
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static QPalette * sys_pal
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...
Definition: qobject.h:275
int size() const
Returns the number of items in the hash.
Definition: qhash.h:295
static QCoreApplication * instance()
Returns a pointer to the application&#39;s QCoreApplication (or QApplication) instance.
virtual void polish(QWidget *)
Initializes the appearance of the given widget.
Definition: qstyle.cpp:390
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ setScreenTransformation()

void QApplicationPrivate::setScreenTransformation ( QScreen screen,
int  screenNo,
int  transformation 
)

Definition at line 329 of file qapplication_qws.cpp.

Referenced by QWSDisplay::Data::fillQueue(), QApplication::qwsProcessEvent(), and setScreenTransformation().

332 {
333  QScreen *transformed = screen;
334 
335  while (transformed->classId() == QScreen::ProxyClass)
336  transformed = static_cast<QProxyScreen*>(transformed)->screen();
337 
338  if (transformed->classId() != QScreen::TransformedClass)
339  return;
340 
342  if (!setScreenTransformation)
343  return;
344 
345  setScreenTransformation(transformed, transformation);
346 
347  // need to re-configure() proxies bottom-up
348  if (screen->classId() == QScreen::ProxyClass) {
349  QList<QProxyScreen*> proxies;
350  QScreen *s = screen;
351 
352  do {
353  QProxyScreen *proxy = static_cast<QProxyScreen*>(s);
354  proxies.append(proxy);
355  s = proxy->screen();
356  } while (s->classId() == QScreen::ProxyClass);
357 
358  do {
359  QProxyScreen *proxy = proxies.takeLast();
360  proxy->setScreen(proxy->screen()); // triggers configure()
361  } while (!proxies.isEmpty());
362  }
363 
364  if (qt_desktopWidget) { // XXX workaround crash for early screen transform events
366 
367  emit desktop->resized(screenNo);
368  if (maxWindowRect(screen).isEmpty()) // not explicitly set
369  emit desktop->workAreaResized(screenNo);
370  }
371 
373  if (server) {
374  server->updateWindowRegions();
375  QRegion r = screen->region();
376  server->refresh(r);
377  }
378 
379  // make sure maximized and fullscreen windows are updated
381  for (int i = list.size() - 1; i >= 0; --i) {
382  QWidget *w = list.at(i);
383  if (w->isFullScreen())
384  w->d_func()->setFullScreenSize_helper();
385  else if (w->isMaximized())
386  w->d_func()->setMaxWindowState_helper();
387  }
388 }
QRect maxWindowRect(const QScreen *screen) const
The QProxyScreen class provides a generic interface to QScreen implementations.
void setScreen(QScreen *screen)
Sets the real screen to be used by the proxy screen.
static QWSServer * instance()
void refresh()
Refreshes the display by making the screen driver update the entire display.
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void workAreaResized(int)
static TransformFunc getTransformationFunction()
void updateWindowRegions() const
void(* TransformFunc)(QScreen *, int)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
static bool isEmpty(const char *str)
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
void resized(int)
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
bool isMaximized() const
Definition: qwidget.cpp:3074
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
static QAuServer & server()
Definition: qsound.cpp:79
The QWSServer class encapsulates a server process in Qt for Embedded Linux.
bool isFullScreen() const
Definition: qwidget.cpp:3153
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
T takeLast()
Removes the last item in the list and returns it.
Definition: qlist.h:492
ClassId classId() const
Returns the class identifier for the screen object.
QScreen * screen() const
Returns the real screen used by the proxy screen.
void setScreenTransformation(QScreen *screen, int screenNo, int transformation)
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QDesktopWidget * qt_desktopWidget

◆ setSystemFont()

void QApplicationPrivate::setSystemFont ( const QFont font)
static
Warning
This function is not part of the public interface.

Definition at line 2123 of file qapplication.cpp.

Referenced by init_display(), QGtkStyle::polish(), qt_init(), qt_set_windows_font_resources(), qt_set_x11_resources(), and x11_apply_settings().

2124 {
2125  if (!sys_font)
2126  sys_font = new QFont(font);
2127  else
2128  *sys_font = font;
2129 
2132 }
static QFont * sys_font
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
static QFont * set_font
static void setFont(const QFont &, const char *className=0)
Changes the default application font to font.

◆ setSystemPalette()

void QApplicationPrivate::setSystemPalette ( const QPalette pal)
static

Definition at line 1948 of file qapplication.cpp.

Referenced by QGtkStyle::polish(), qt_set_windows_color_resources(), QApplication::setStyle(), QApplication::style(), QGtkStyleUpdateScheduler::updateTheme(), and x11_apply_settings().

1949 {
1950  QPalette adjusted;
1951 
1952 #if 0
1953  // adjust the system palette to avoid dithering
1955  if (cmap.depths() > 4 && cmap.depths() < 24) {
1956  for (int g = 0; g < QPalette::NColorGroups; g++)
1957  for (int i = 0; i < QPalette::NColorRoles; i++) {
1959  color = cmap.colorAt(cmap.pixel(color));
1960  adjusted.setColor((QPalette::ColorGroup)g, (QPalette::ColorRole) i, color);
1961  }
1962  }
1963 #else
1964  adjusted = pal;
1965 #endif
1966 
1967  if (!sys_pal)
1968  sys_pal = new QPalette(adjusted);
1969  else
1970  *sys_pal = adjusted;
1971 
1972 
1975 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
static QColormap instance(int screen=-1)
static void setPalette(const QPalette &, const char *className=0)
Changes the default application palette to palette.
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
Definition: qpalette.h:93
static QPalette * set_pal
static QColor cmap[256]
Definition: qgl_mac.mm:760
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
Definition: qpalette.h:107
ColorGroup
Definition: qpalette.h:92
const QColor colorAt(uint pixel) const
static QPalette * sys_pal
uint pixel(const QColor &color) const
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...
Definition: qpalette.h:201
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ shouldSetFocus()

bool QApplicationPrivate::shouldSetFocus ( QWidget w,
Qt::FocusPolicy  policy 
)
staticprivate

Definition at line 5832 of file qapplication.cpp.

Referenced by giveFocusAccordingToFocusPolicy().

5833 {
5834  QWidget *f = w;
5835  while (f->d_func()->extra && f->d_func()->extra->focus_proxy)
5836  f = f->d_func()->extra->focus_proxy;
5837 
5838  if ((w->focusPolicy() & policy) != policy)
5839  return false;
5840  if (w != f && (f->focusPolicy() & policy) != policy)
5841  return false;
5842  return true;
5843 }
Qt::FocusPolicy focusPolicy
the way the widget accepts keyboard focus
Definition: qwidget.h:187
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150

◆ tabletProximityCallback()

OSStatus QApplicationPrivate::tabletProximityCallback ( EventHandlerCallRef  ,
EventRef  carbonEvent,
void *   
)
static

Definition at line 1618 of file qapplication_mac.mm.

Referenced by qt_init().

1620 {
1621  OSType eventClass = GetEventClass(carbonEvent);
1622  UInt32 eventKind = GetEventKind(carbonEvent);
1623  if (eventClass != kEventClassTablet || eventKind != kEventTabletProximity)
1624  return eventNotHandledErr;
1625 
1626  // Get the current point of the device and its unique ID.
1627  ::TabletProximityRec proxRec;
1628  GetEventParameter(carbonEvent, kEventParamTabletProximityRec, typeTabletProximityRec, 0,
1629  sizeof(proxRec), 0, &proxRec);
1631  return noErr;
1632 }
void qt_dispatchTabletProximityEvent(const ::TabletProximityRec &proxRec)

◆ translateRawTouchEvent()

void QApplicationPrivate::translateRawTouchEvent ( QWidget widget,
QTouchEvent::DeviceType  deviceType,
const QList< QTouchEvent::TouchPoint > &  touchPoints 
)
static

Definition at line 6031 of file qapplication.cpp.

Referenced by qt_cleanup(), and qt_translateRawTouchEvent().

6034 {
6035  QApplicationPrivate *d = self;
6036  typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints;
6037  QHash<QWidget *, StatesAndTouchPoints> widgetsNeedingEvents;
6038 
6039  for (int i = 0; i < touchPoints.count(); ++i) {
6040  QTouchEvent::TouchPoint touchPoint = touchPoints.at(i);
6041  // explicitly detach from the original touch point that we got, so even
6042  // if the touchpoint structs are reused, we will make a copy that we'll
6043  // deliver to the user (which might want to store the struct for later use).
6044  touchPoint.d = touchPoint.d->detach();
6045 
6046  // update state
6048  switch (touchPoint.state()) {
6049  case Qt::TouchPointPressed:
6050  {
6051  if (deviceType == QTouchEvent::TouchPad) {
6052  // on touch-pads, send all touch points to the same widget
6053  widget = d->widgetForTouchPointId.isEmpty()
6055  : d->widgetForTouchPointId.constBegin().value();
6056  }
6057 
6058  if (!widget) {
6059  // determine which widget this event will go to
6060  if (!window)
6062  if (!window)
6063  continue;
6064  widget = window->childAt(window->mapFromGlobal(touchPoint.screenPos().toPoint()));
6065  if (!widget)
6066  widget = window;
6067  }
6068 
6069  if (deviceType == QTouchEvent::TouchScreen) {
6070  int closestTouchPointId = d->findClosestTouchPointId(touchPoint.screenPos());
6071  QWidget *closestWidget = d->widgetForTouchPointId.value(closestTouchPointId).data();
6072  if (closestWidget
6073  && (widget.data()->isAncestorOf(closestWidget) || closestWidget->isAncestorOf(widget.data()))) {
6074  widget = closestWidget;
6075  }
6076  }
6077 
6078  d->widgetForTouchPointId[touchPoint.id()] = widget;
6079  touchPoint.d->startScreenPos = touchPoint.screenPos();
6080  touchPoint.d->lastScreenPos = touchPoint.screenPos();
6081  touchPoint.d->startNormalizedPos = touchPoint.normalizedPos();
6082  touchPoint.d->lastNormalizedPos = touchPoint.normalizedPos();
6083  if (touchPoint.pressure() < qreal(0.))
6084  touchPoint.d->pressure = qreal(1.);
6085 
6086  d->appCurrentTouchPoints.insert(touchPoint.id(), touchPoint);
6087  break;
6088  }
6090  {
6091  widget = d->widgetForTouchPointId.take(touchPoint.id());
6092  if (!widget)
6093  continue;
6094 
6095  QTouchEvent::TouchPoint previousTouchPoint = d->appCurrentTouchPoints.take(touchPoint.id());
6096  touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos();
6097  touchPoint.d->lastScreenPos = previousTouchPoint.screenPos();
6098  touchPoint.d->startPos = previousTouchPoint.startPos();
6099  touchPoint.d->lastPos = previousTouchPoint.pos();
6100  touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos();
6101  touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos();
6102  if (touchPoint.pressure() < qreal(0.))
6103  touchPoint.d->pressure = qreal(0.);
6104  break;
6105  }
6106  default:
6107  widget = d->widgetForTouchPointId.value(touchPoint.id());
6108  if (!widget)
6109  continue;
6110 
6111  Q_ASSERT(d->appCurrentTouchPoints.contains(touchPoint.id()));
6112  QTouchEvent::TouchPoint previousTouchPoint = d->appCurrentTouchPoints.value(touchPoint.id());
6113  touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos();
6114  touchPoint.d->lastScreenPos = previousTouchPoint.screenPos();
6115  touchPoint.d->startPos = previousTouchPoint.startPos();
6116  touchPoint.d->lastPos = previousTouchPoint.pos();
6117  touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos();
6118  touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos();
6119  if (touchPoint.pressure() < qreal(0.))
6120  touchPoint.d->pressure = qreal(1.);
6121  d->appCurrentTouchPoints[touchPoint.id()] = touchPoint;
6122  break;
6123  }
6124  Q_ASSERT(widget.data() != 0);
6125 
6126  // make the *scene* functions return the same as the *screen* functions
6127  touchPoint.d->sceneRect = touchPoint.screenRect();
6128  touchPoint.d->startScenePos = touchPoint.startScreenPos();
6129  touchPoint.d->lastScenePos = touchPoint.lastScreenPos();
6130 
6131  StatesAndTouchPoints &maskAndPoints = widgetsNeedingEvents[widget.data()];
6132  maskAndPoints.first |= touchPoint.state();
6133  if (touchPoint.isPrimary())
6134  maskAndPoints.first |= Qt::TouchPointPrimary;
6135  maskAndPoints.second.append(touchPoint);
6136  }
6137 
6138  if (widgetsNeedingEvents.isEmpty())
6139  return;
6140 
6143  for (; it != end; ++it) {
6144  QWidget *widget = it.key();
6145  if (!QApplicationPrivate::tryModalHelper(widget, 0))
6146  continue;
6147 
6148  QEvent::Type eventType;
6149  switch (it.value().first & Qt::TouchPointStateMask) {
6150  case Qt::TouchPointPressed:
6151  eventType = QEvent::TouchBegin;
6152  break;
6154  eventType = QEvent::TouchEnd;
6155  break;
6157  // don't send the event if nothing changed
6158  continue;
6159  default:
6160  eventType = QEvent::TouchUpdate;
6161  break;
6162  }
6163 
6164  QTouchEvent touchEvent(eventType,
6165  deviceType,
6167  it.value().first,
6168  it.value().second);
6170 
6171  switch (touchEvent.type()) {
6172  case QEvent::TouchBegin:
6173  {
6174  // if the TouchBegin handler recurses, we assume that means the event
6175  // has been implicitly accepted and continue to send touch events
6178  break;
6179  }
6180  default:
6182  if (touchEvent.type() == QEvent::TouchEnd)
6185  }
6186  break;
6187  }
6188  }
6189 }
double d
Definition: qnumeric_p.h:62
int id() const
Returns the id number of this touch point.
Definition: qevent.cpp:4445
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
Definition: qhash.h:395
double qreal
Definition: qglobal.h:1193
QPointer< QWidget > widget
Qt::TouchPointState state() const
Returns the current state of this touch point.
Definition: qevent.cpp:4453
#define it(className, varName)
static void updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent)
QMap< int, QTouchEvent::TouchPoint > appCurrentTouchPoints
QPointF lastScreenPos() const
Returns the screen position of this touch point from the previous touch event.
Definition: qevent.cpp:4598
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QPointF normalizedPos() const
Returns the normalized position of this touch point.
Definition: qevent.cpp:4511
T * data() const
const Key & key() const
Returns the current item&#39;s key.
Definition: qhash.h:419
qreal pressure() const
Returns the pressure of this touch point.
Definition: qevent.cpp:4657
NSWindow * window
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
const T value(const Key &key) const
Returns the value associated with the key key.
Definition: qmap.h:499
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Definition: qhash.h:297
const T & value() const
Returns the current item&#39;s value.
Definition: qhash.h:420
QPointF screenPos() const
Returns the screen position of this touch point.
Definition: qevent.cpp:4498
QPointF startNormalizedPos() const
Returns the normalized starting position of this touch point.
Definition: qevent.cpp:4560
QPointF startScreenPos() const
Returns the starting screen position of this touch point.
Definition: qevent.cpp:4547
QTouchEventTouchPointPrivate * detach()
Definition: qevent_p.h:108
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
Definition: qmap.h:374
static QWidget * topLevelAt(const QPoint &p)
Returns the top-level widget at the given point; returns 0 if there is no such widget.
int findClosestTouchPointId(const QPointF &screenPos)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
static bool tryModalHelper(QWidget *widget, QWidget **rettop=0)
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition: qpoint.h:376
QPointF pos() const
Returns the position of this touch point, relative to the widget or QGraphicsItem that received the e...
Definition: qevent.cpp:4473
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
Definition: qmap.h:559
bool isEmpty() const
Returns true if the map contains no items; otherwise returns false.
Definition: qmap.h:203
bool isAncestorOf(const QWidget *child) const
Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child...
Definition: qwidget.cpp:8573
QTouchEventTouchPointPrivate * d
Definition: qevent.h:800
QMap< int, QWeakPointer< QWidget > > widgetForTouchPointId
bool contains(const Key &key) const
Returns true if the map contains an item with key key; otherwise returns false.
Definition: qmap.h:553
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
bool isPrimary() const
Returns true if this touch point is the primary touch point.
Definition: qevent.cpp:4462
The TouchPoint class provides information about a touch point in a QTouchEvent.
Definition: qevent.h:744
The QTouchEvent class contains parameters that describe a touch event.
Definition: qevent.h:741
T take(const Key &key)
Removes the item with the key key from the map and returns the value associated with it...
Definition: qmap.h:692
QRectF screenRect() const
Returns the rect for this touch point in screen coordinates.
Definition: qevent.cpp:4648
QTouchEventSequence touchEvent(QWidget *widget=0, QTouchEvent::DeviceType deviceType=QTouchEvent::TouchScreen)
Creates and returns a QTouchEventSequence for the device deviceType to simulate events for widget...
Definition: qtesttouch.h:141
static const KeyPair *const end
QPointF startPos() const
Returns the starting position of this touch point, relative to the widget or QGraphicsItem that recei...
Definition: qevent.cpp:4522

◆ translateTouchEvent()

bool QApplicationPrivate::translateTouchEvent ( const MSG msg)

Definition at line 4222 of file qapplication_win.cpp.

Referenced by QtWndProc().

4223 {
4224  QWidget *widgetForHwnd = QWidget::find(msg.hwnd);
4225  if (!widgetForHwnd)
4226  return false;
4227 
4228  QRect screenGeometry = QApplication::desktop()->screenGeometry(widgetForHwnd);
4229 
4230  QList<QTouchEvent::TouchPoint> touchPoints;
4231 
4232  QVector<TOUCHINPUT> winTouchInputs(msg.wParam);
4233  memset(winTouchInputs.data(), 0, sizeof(TOUCHINPUT) * winTouchInputs.count());
4234  Qt::TouchPointStates allStates = 0;
4235  QApplicationPrivate::GetTouchInputInfo((HANDLE) msg.lParam, msg.wParam, winTouchInputs.data(), sizeof(TOUCHINPUT));
4236  for (int i = 0; i < winTouchInputs.count(); ++i) {
4237  const TOUCHINPUT &touchInput = winTouchInputs.at(i);
4238 
4239  int touchPointID = touchInputIDToTouchPointID.value(touchInput.dwID, -1);
4240  if (touchPointID == -1) {
4241  touchPointID = touchInputIDToTouchPointID.count();
4242  touchInputIDToTouchPointID.insert(touchInput.dwID, touchPointID);
4243  }
4244 
4245  QTouchEvent::TouchPoint touchPoint(touchPointID);
4246 
4247  // update state
4248  QPointF screenPos(qreal(touchInput.x) / qreal(100.), qreal(touchInput.y) / qreal(100.));
4249  QRectF screenRect;
4250  if (touchInput.dwMask & TOUCHINPUTMASKF_CONTACTAREA)
4251  screenRect.setSize(QSizeF(qreal(touchInput.cxContact) / qreal(100.),
4252  qreal(touchInput.cyContact) / qreal(100.)));
4253  screenRect.moveCenter(screenPos);
4254 
4255  Qt::TouchPointStates state;
4256  if (touchInput.dwFlags & TOUCHEVENTF_DOWN) {
4257  state = Qt::TouchPointPressed;
4258  } else if (touchInput.dwFlags & TOUCHEVENTF_UP) {
4259  state = Qt::TouchPointReleased;
4260  } else {
4261  state = (screenPos == touchPoint.screenPos()
4264  }
4265  if (touchInput.dwFlags & TOUCHEVENTF_PRIMARY)
4266  state |= Qt::TouchPointPrimary;
4267  touchPoint.setState(state);
4268  touchPoint.setScreenRect(screenRect);
4269  touchPoint.setNormalizedPos(QPointF(screenPos.x() / screenGeometry.width(),
4270  screenPos.y() / screenGeometry.height()));
4271 
4272  allStates |= state;
4273 
4274  touchPoints.append(touchPoint);
4275  }
4277 
4278  if ((allStates & Qt::TouchPointStateMask) == Qt::TouchPointReleased) {
4279  // all touch points released, forget the ids we've seen, they may not be reused
4281  }
4282 
4283  translateRawTouchEvent(widgetForHwnd, QTouchEvent::TouchScreen, touchPoints);
4284  return true;
4285 }
double qreal
Definition: qglobal.h:1193
void clear()
Removes all items from the hash.
Definition: qhash.h:574
QHash< DWORD, int > touchInputIDToTouchPointID
static PtrCloseTouchInputHandle CloseTouchInputHandle
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define TOUCHEVENTF_UP
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
#define TOUCHEVENTF_DOWN
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517
struct tagTOUCHINPUT TOUCHINPUT
void * HANDLE
Definition: qnamespace.h:1671
static PtrGetTouchInputInfo GetTouchInputInfo
void setSize(const QSizeF &s)
Sets the size of the rectangle to the given size.
Definition: qrect.h:790
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
const QRect screenGeometry(int screen=-1) const
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
The TouchPoint class provides information about a touch point in a QTouchEvent.
Definition: qevent.h:744
int count(const Key &key) const
Returns the number of items associated with the key.
Definition: qhash.h:719
#define TOUCHEVENTF_PRIMARY
#define TOUCHINPUTMASKF_CONTACTAREA
static void translateRawTouchEvent(QWidget *widget, QTouchEvent::DeviceType deviceType, const QList< QTouchEvent::TouchPoint > &touchPoints)
void moveCenter(const QPointF &p)
Moves the rectangle, leaving the center point at the given position.
Definition: qrect.h:705

◆ tryModalHelper()

bool QApplicationPrivate::tryModalHelper ( QWidget widget,
QWidget **  rettop = 0 
)
static
Warning
This function is not part of the public interface.

Called from qapplication_platform.cpp, returns true if the widget should accept the event.

Definition at line 3102 of file qapplication.cpp.

Referenced by QShortcutMap::correctGraphicsWidgetContext(), QShortcutMap::correctWidgetContext(), dispatchEnterLeave(), QOleDropTarget::DragEnter(), QOleDropTarget::DragLeave(), QOleDropTarget::DragOver(), QOleDropTarget::Drop(), qt_try_modal(), qt_tryModalHelper(), QtWndProc(), QWidgetPrivate::show_sys(), translateRawTouchEvent(), QApplication::x11ClientMessage(), and QApplication::x11ProcessEvent().

3103 {
3105  if (rettop)
3106  *rettop = top;
3107 
3108  // the active popup widget always gets the input event
3110  return true;
3111 
3112 #if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
3114  if (rettop)
3115  *rettop = top;
3116 #endif
3117 
3118  return !isBlockedByModal(widget->window());
3119 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QWidget * activeModalWidget()
Returns the active modal widget.
static QWidget * activePopupWidget()
Returns the active popup widget.
static bool isBlockedByModal(QWidget *widget)
Returns true if widget is blocked by a modal window.
static QWidget * tryModalHelper_sys(QWidget *top)
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492

◆ tryModalHelper_sys()

QWidget * QApplicationPrivate::tryModalHelper_sys ( QWidget top)
static

Definition at line 1569 of file qapplication_mac.mm.

Referenced by tryModalHelper().

1570 {
1571 #ifndef QT_MAC_USE_COCOA
1572  if(top && qt_mac_is_macsheet(top) && !IsWindowVisible(qt_mac_window_for(top))) {
1573  if(OSWindowRef wp = GetFrontWindowOfClass(kSheetWindowClass, true)) {
1574  if(QWidget *sheet = qt_mac_find_window(wp))
1575  top = sheet;
1576  }
1577  }
1578 #endif
1579  return top;
1580 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
WindowRef OSWindowRef
QWidget * qt_mac_find_window(OSWindowRef)
Definition: qwidget_mac.mm:391
bool qt_mac_is_macsheet(const QWidget *)
Definition: qwidget_mac.mm:295

◆ updateTouchPointsForWidget()

void QApplicationPrivate::updateTouchPointsForWidget ( QWidget widget,
QTouchEvent touchEvent 
)
static

Definition at line 5982 of file qapplication.cpp.

5983 {
5984  for (int i = 0; i < touchEvent->touchPoints().count(); ++i) {
5985  QTouchEvent::TouchPoint &touchPoint = touchEvent->_touchPoints[i];
5986 
5987  // preserve the sub-pixel resolution
5988  QRectF rect = touchPoint.screenRect();
5989  const QPointF screenPos = rect.center();
5990  const QPointF delta = screenPos - screenPos.toPoint();
5991 
5992  rect.moveCenter(widget->mapFromGlobal(screenPos.toPoint()) + delta);
5993  touchPoint.d->rect = rect;
5994  if (touchPoint.state() == Qt::TouchPointPressed) {
5995  touchPoint.d->startPos = widget->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta;
5996  touchPoint.d->lastPos = widget->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta;
5997  }
5998  }
5999 }
Qt::TouchPointState state() const
Returns the current state of this touch point.
Definition: qevent.cpp:4453
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
QPointF lastScreenPos() const
Returns the screen position of this touch point from the previous touch event.
Definition: qevent.cpp:4598
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QList< QTouchEvent::TouchPoint > _touchPoints
Definition: qevent.h:832
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QPointF startScreenPos() const
Returns the starting screen position of this touch point.
Definition: qevent.cpp:4547
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition: qpoint.h:376
const QList< QTouchEvent::TouchPoint > & touchPoints() const
Returns the list of touch points contained in the touch event.
Definition: qevent.h:820
QTouchEventTouchPointPrivate * d
Definition: qevent.h:800
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
The TouchPoint class provides information about a touch point in a QTouchEvent.
Definition: qevent.h:744
QRectF screenRect() const
Returns the rect for this touch point in screen coordinates.
Definition: qevent.cpp:4648
void moveCenter(const QPointF &p)
Moves the rectangle, leaving the center point at the given position.
Definition: qrect.h:705
QPointF center() const
Returns the center point of the rectangle.
Definition: qrect.h:686

◆ x11_apply_settings()

bool QApplicationPrivate::x11_apply_settings ( )
static
Warning
This function is not part of the public interface. apply the settings to the application

Definition at line 867 of file qapplication_x11.cpp.

Referenced by qt_set_x11_resources().

868 {
869  QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
870 
871  settings.beginGroup(QLatin1String("Qt"));
872 
873  /*
874  Qt settings. This is now they are written into the datastream.
875 
876  Palette / * - QPalette
877  font - QFont
878  libraryPath - QStringList
879  style - QString
880  doubleClickInterval - int
881  keyboardInputInterval - int
882  cursorFlashTime - int
883  wheelScrollLines - int
884  colorSpec - QString
885  defaultCodec - QString
886  globalStrut/width - int
887  globalStrut/height - int
888  GUIEffects - QStringList
889  Font Substitutions/ * - QStringList
890  Font Substitutions/... - QStringList
891  */
892 
893  QStringList strlist;
894  int i;
895  QPalette pal(Qt::black);
896  int groupCount = 0;
897  strlist = settings.value(QLatin1String("Palette/active")).toStringList();
898  if (!strlist.isEmpty()) {
899  ++groupCount;
900  for (i = 0; i < qMin(strlist.count(), int(QPalette::NColorRoles)); i++)
901  pal.setColor(QPalette::Active, (QPalette::ColorRole) i,
902  QColor(strlist[i]));
903  }
904  strlist = settings.value(QLatin1String("Palette/inactive")).toStringList();
905  if (!strlist.isEmpty()) {
906  ++groupCount;
907  for (i = 0; i < qMin(strlist.count(), int(QPalette::NColorRoles)); i++)
908  pal.setColor(QPalette::Inactive, (QPalette::ColorRole) i,
909  QColor(strlist[i]));
910  }
911  strlist = settings.value(QLatin1String("Palette/disabled")).toStringList();
912  if (!strlist.isEmpty()) {
913  ++groupCount;
914  for (i = 0; i < qMin(strlist.count(), int(QPalette::NColorRoles)); i++)
915  pal.setColor(QPalette::Disabled, (QPalette::ColorRole) i,
916  QColor(strlist[i]));
917  }
918 
919  // ### Fix properly for 4.6
920  bool usingGtkSettings = QApplicationPrivate::app_style && QApplicationPrivate::app_style->inherits("QGtkStyle");
921  if (!usingGtkSettings) {
922  if (groupCount == QPalette::NColorGroups)
924  }
925 
926  if (!appFont) {
927  // ### Fix properly for 4.6
928  if (!usingGtkSettings) {
929  QFont font(QApplication::font());
930  QString fontDescription;
931  // Override Qt font if KDE4 settings can be used
932  if (X11->desktopVersion == 4) {
933  QSettings kdeSettings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
934  fontDescription = kdeSettings.value(QLatin1String("font")).toString();
935  if (fontDescription.isEmpty()) {
936  // KDE stores fonts without quotes
937  fontDescription = kdeSettings.value(QLatin1String("font")).toStringList().join(QLatin1String(","));
938  }
939  }
940  if (fontDescription.isEmpty())
941  fontDescription = settings.value(QLatin1String("font")).toString();
942  if (!fontDescription .isEmpty()) {
943  font.fromString(fontDescription );
945  }
946  }
947  }
948 
949  // read library (ie. plugin) path list
950  QString libpathkey =
951  QString::fromLatin1("%1.%2/libraryPath")
952  .arg(QT_VERSION >> 16)
953  .arg((QT_VERSION & 0xff00) >> 8);
954  QStringList pathlist = settings.value(libpathkey).toString().split(QLatin1Char(':'));
955  if (! pathlist.isEmpty()) {
957  while (it != pathlist.constEnd())
959  }
960 
961  // read new QStyle
962  QString stylename = settings.value(QLatin1String("style")).toString();
963 
964  if (stylename.isEmpty() && QApplicationPrivate::styleOverride.isNull() && X11->use_xrender) {
965  stylename = qt_guiPlatformPlugin()->styleName();
966  }
967 
968  static QString currentStyleName = stylename;
970  if (!stylename.isEmpty() && QApplicationPrivate::styleOverride.isNull())
972  } else {
973  if (currentStyleName != stylename) {
974  currentStyleName = stylename;
975  QApplication::setStyle(stylename);
976  }
977  }
978 
979  int num =
980  settings.value(QLatin1String("doubleClickInterval"),
983 
984  num =
985  settings.value(QLatin1String("cursorFlashTime"),
988 
989 #ifndef QT_NO_WHEELEVENT
990  num =
991  settings.value(QLatin1String("wheelScrollLines"),
994 #endif
995 
996  QString colorspec = settings.value(QLatin1String("colorSpec"),
997  QVariant(QLatin1String("default"))).toString();
998  if (colorspec == QLatin1String("normal"))
1000  else if (colorspec == QLatin1String("custom"))
1002  else if (colorspec == QLatin1String("many"))
1004  else if (colorspec != QLatin1String("default"))
1005  colorspec = QLatin1String("default");
1006 
1007  QString defaultcodec = settings.value(QLatin1String("defaultCodec"),
1008  QVariant(QLatin1String("none"))).toString();
1009  if (defaultcodec != QLatin1String("none")) {
1011  if (codec)
1013  }
1014 
1015  int w = settings.value(QLatin1String("globalStrut/width")).toInt();
1016  int h = settings.value(QLatin1String("globalStrut/height")).toInt();
1017  QSize strut(w, h);
1018  if (strut.isValid())
1020 
1021  QStringList effects = settings.value(QLatin1String("GUIEffects")).toStringList();
1023  effects.contains(QLatin1String("general")));
1025  effects.contains(QLatin1String("animatemenu")));
1027  effects.contains(QLatin1String("fademenu")));
1029  effects.contains(QLatin1String("animatecombo")));
1031  effects.contains(QLatin1String("animatetooltip")));
1033  effects.contains(QLatin1String("fadetooltip")));
1035  effects.contains(QLatin1String("animatetoolbox")));
1036 
1037  if (!X11->has_fontconfig) {
1038  settings.beginGroup(QLatin1String("Font Substitutions"));
1039  QStringList fontsubs = settings.childKeys();
1040  if (!fontsubs.isEmpty()) {
1041  QStringList::Iterator it = fontsubs.begin();
1042  for (; it != fontsubs.end(); ++it) {
1043  QString fam = *it;
1044  QStringList subs = settings.value(fam).toStringList();
1045  QFont::insertSubstitutions(fam, subs);
1046  }
1047  }
1048  settings.endGroup();
1049  }
1050 
1052  settings.value(QLatin1String("useRtlExtensions"), false).toBool();
1053 
1054 #ifndef QT_NO_IM
1055 #ifndef QT_NO_XIM
1056  if (qt_xim_preferred_style == 0) {
1057  QString ximInputStyle = settings.value(QLatin1String("XIMInputStyle"),
1058  QVariant(QLatin1String("on the spot"))).toString().toLower();
1059  if (ximInputStyle == QLatin1String("on the spot"))
1060  qt_xim_preferred_style = XIMPreeditCallbacks | XIMStatusNothing;
1061  else if (ximInputStyle == QLatin1String("over the spot"))
1062  qt_xim_preferred_style = XIMPreeditPosition | XIMStatusNothing;
1063  else if (ximInputStyle == QLatin1String("off the spot"))
1064  qt_xim_preferred_style = XIMPreeditArea | XIMStatusArea;
1065  else if (ximInputStyle == QLatin1String("root"))
1066  qt_xim_preferred_style = XIMPreeditNothing | XIMStatusNothing;
1067  }
1068 #endif // QT_NO_XIM
1069  QStringList inputMethods = QInputContextFactory::keys();
1070  if (inputMethods.size() > 2 && inputMethods.contains(QLatin1String("imsw-multi"))) {
1071  X11->default_im = QLatin1String("imsw-multi");
1072  } else {
1073  X11->default_im = settings.value(QLatin1String("DefaultInputMethod"),
1074  QLatin1String("xim")).toString();
1075  }
1076 #endif //QT_NO_IM
1077  settings.endGroup(); // Qt
1078 
1079  return true;
1080 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
static const char * appFont
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
Definition: qpalette.h:93
static void setStyle(QStyle *)
Sets the application&#39;s GUI style to style.
XIMStyle qt_xim_preferred_style
#define it(className, varName)
The QSettings class provides persistent platform-independent application settings.
Definition: qsettings.h:73
static void addLibraryPath(const QString &)
Prepends path to the beginning of the library path list, ensuring that it is searched for libraries f...
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
Definition: qlist.h:267
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QGuiPlatformPlugin * qt_guiPlatformPlugin()
Return (an construct if necesseray) the Gui Platform plugin.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
static int cursorFlashTime()
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define X11
Definition: qt_x11_p.h:724
static int wheelScrollLines()
iterator Iterator
Qt-style synonym for QList::iterator.
Definition: qlist.h:278
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
static QFont font()
Returns the default application font.
static void setSystemFont(const QFont &font)
static bool isEmpty(const char *str)
bool qt_use_rtl_extensions
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:270
static void insertSubstitutions(const QString &, const QStringList &)
Inserts the list of families substituteNames into the substitution list for familyName.
Definition: qfont.cpp:2175
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
static QTextCodec * codec(MYSQL *mysql)
Definition: qsql_mysql.cpp:220
static QStyle * app_style
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
T value(int i) const
Returns the value at index position i in the list.
Definition: qlist.h:661
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
static QStringList keys()
Returns the list of keys this factory can create input contexts for.
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...
Definition: qobject.h:275
static bool startingUp()
Returns true if an application object has not been created yet; otherwise returns false...
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition: qstring.h:505
static void setColorSpec(int)
Sets the color specification for the application to spec.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
static void setCursorFlashTime(int)
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
const_iterator ConstIterator
Qt-style synonym for QList::const_iterator.
Definition: qlist.h:279
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
Definition: qstring.cpp:5389
static void setWheelScrollLines(int)
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
static void setSystemPalette(const QPalette &pal)
QString kdeHome()
Definition: qkde.cpp:59
virtual QString styleName()
static QString styleOverride
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
static void setDoubleClickInterval(int)
The QTextCodec class provides conversions between text encodings.
Definition: qtextcodec.h:62
static int doubleClickInterval()
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
static void setGlobalStrut(const QSize &)
static void setCodecForTr(QTextCodec *c)
Definition: qtextcodec.h:156
static void setEffectEnabled(Qt::UIEffect, bool enable=true)
Enables the UI effect effect if enable is true, otherwise the effect will not be used.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272
#define QT_VERSION
This macro expands a numeric value of the form 0xMMNNPP (MM = major, NN = minor, PP = patch) that spe...
Definition: qglobal.h:51
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ x11_initialize_style()

static void QApplicationPrivate::x11_initialize_style ( )
static

Properties

◆ active_window

QWidget * QApplicationPrivate::active_window = 0
static

◆ alertTimerHash

QHash<QWidget *, QTimer *> QApplicationPrivate::alertTimerHash

Definition at line 535 of file qapplication_p.h.

◆ animate_combo

bool QApplicationPrivate::animate_combo = false
static

◆ animate_menu

bool QApplicationPrivate::animate_menu = false
static

◆ animate_toolbox

bool QApplicationPrivate::animate_toolbox = false
static

◆ animate_tooltip

bool QApplicationPrivate::animate_tooltip = false
static

◆ animate_ui

bool QApplicationPrivate::animate_ui = true
static

◆ app_cspec

int QApplicationPrivate::app_cspec = QApplication::NormalColor
static

◆ app_font

QFont * QApplicationPrivate::app_font = 0
staticprivate

◆ app_icon

QIcon * QApplicationPrivate::app_icon = 0
static

◆ app_pal

QPalette * QApplicationPrivate::app_pal = 0
static

◆ app_strut

QSize QApplicationPrivate::app_strut = QSize(0,0)
static

Definition at line 417 of file qapplication_p.h.

Referenced by QApplication::setColorSpec().

◆ app_style

QStyle * QApplicationPrivate::app_style = 0
static

◆ appCurrentTouchPoints

QMap<int, QTouchEvent::TouchPoint> QApplicationPrivate::appCurrentTouchPoints

Definition at line 581 of file qapplication_p.h.

Referenced by translateRawTouchEvent().

◆ autoMaximizeThreshold

int QApplicationPrivate::autoMaximizeThreshold = -1
static

Definition at line 305 of file qapplication_p.h.

Referenced by QApplication::setAutoMaximizeThreshold().

◆ autoSipEnabled

bool QApplicationPrivate::autoSipEnabled = false
static

Definition at line 307 of file qapplication_p.h.

Referenced by QApplication::setAutoSipEnabled().

◆ BeginPanningFeedback

PtrBeginPanningFeedback QApplicationPrivate::BeginPanningFeedback

Definition at line 609 of file qapplication_p.h.

Referenced by qt_init().

◆ CloseGestureInfoHandle

PtrCloseGestureInfoHandle QApplicationPrivate::CloseGestureInfoHandle

Definition at line 606 of file qapplication_p.h.

Referenced by qt_init(), and QtWndProc().

◆ CloseTouchInputHandle

PtrCloseTouchInputHandle QApplicationPrivate::CloseTouchInputHandle = 0
static

Definition at line 598 of file qapplication_p.h.

Referenced by QSessionManager::cancel(), and translateTouchEvent().

◆ copy_cursor

QPixmap* QApplicationPrivate::copy_cursor

Definition at line 572 of file qapplication_p.h.

Referenced by QApplicationPrivate().

◆ cursor_flash_time

int QApplicationPrivate::cursor_flash_time = 1000
static

◆ cursor_list

QList<QCursor> QApplicationPrivate::cursor_list

Definition at line 382 of file qapplication_p.h.

◆ directPainters

QMap<WId, QDirectPainter *>* QApplicationPrivate::directPainters

Definition at line 517 of file qapplication_p.h.

Referenced by QApplicationPrivate(), and QDirectPainter::QDirectPainter().

◆ EndPanningFeedback

PtrEndPanningFeedback QApplicationPrivate::EndPanningFeedback

Definition at line 611 of file qapplication_p.h.

Referenced by qt_init().

◆ fade_menu

bool QApplicationPrivate::fade_menu = false
static

◆ fade_tooltip

bool QApplicationPrivate::fade_tooltip = false
static

◆ focus_widget

QWidget * QApplicationPrivate::focus_widget = 0
static

◆ gestureManager

QGestureManager* QApplicationPrivate::gestureManager

◆ gestureWidget

QWidget* QApplicationPrivate::gestureWidget

Definition at line 568 of file qapplication_p.h.

Referenced by QApplicationPrivate(), and QtWndProc().

◆ GetGestureConfig

PtrGetGestureConfig QApplicationPrivate::GetGestureConfig

Definition at line 608 of file qapplication_p.h.

Referenced by qt_init().

◆ GetGestureExtraArgs

PtrGetGestureExtraArgs QApplicationPrivate::GetGestureExtraArgs

Definition at line 605 of file qapplication_p.h.

Referenced by qt_init().

◆ GetGestureInfo

PtrGetGestureInfo QApplicationPrivate::GetGestureInfo

Definition at line 604 of file qapplication_p.h.

Referenced by qt_init(), and QtWndProc().

◆ GetTouchInputInfo

PtrGetTouchInputInfo QApplicationPrivate::GetTouchInputInfo = 0
static

Definition at line 597 of file qapplication_p.h.

Referenced by QSessionManager::cancel(), and translateTouchEvent().

◆ graphics_system

QGraphicsSystem * QApplicationPrivate::graphics_system = 0
static

◆ graphics_system_name

QString QApplicationPrivate::graphics_system_name
static

◆ HasTouchSupport

bool QApplicationPrivate::HasTouchSupport = false
static

Definition at line 595 of file qapplication_p.h.

Referenced by QSessionManager::cancel(), and QGestureManager::QGestureManager().

◆ hidden_focus_widget

QWidget * QApplicationPrivate::hidden_focus_widget = 0
static

◆ hoverGlobalPos

QPoint QApplicationPrivate::hoverGlobalPos

Definition at line 391 of file qapplication_p.h.

Referenced by dispatchEnterLeave().

◆ ignore_cursor

QPixmap* QApplicationPrivate::ignore_cursor

Definition at line 576 of file qapplication_p.h.

Referenced by QApplicationPrivate().

◆ inputContext

QInputContext * QApplicationPrivate::inputContext = 0
static

◆ is_session_restored

bool QApplicationPrivate::is_session_restored

Definition at line 378 of file qapplication_p.h.

Referenced by process_cmdline(), and QApplicationPrivate().

◆ keyboard_input_time

int QApplicationPrivate::keyboard_input_time = 400
static

◆ last_manager

QPointer<QWSManager> QApplicationPrivate::last_manager

Definition at line 514 of file qapplication_p.h.

◆ leaveAfterRelease

QPointer< QWidget > QApplicationPrivate::leaveAfterRelease = 0
static

Definition at line 540 of file qapplication_p.h.

Referenced by QETWidget::translateMouseEvent(), and ~QApplicationPrivate().

◆ link_cursor

QPixmap* QApplicationPrivate::link_cursor

Definition at line 573 of file qapplication_p.h.

Referenced by QApplicationPrivate().

◆ load_testability

bool QApplicationPrivate::load_testability = false
static

Definition at line 457 of file qapplication_p.h.

Referenced by process_cmdline().

◆ main_widget

QWidget * QApplicationPrivate::main_widget = 0
static

◆ maxWindowRects

QMap<const QScreen*, QRect> QApplicationPrivate::maxWindowRects
private

Definition at line 643 of file qapplication_p.h.

Referenced by setMaxWindowRect().

◆ modifier_buttons

Qt::KeyboardModifiers QApplicationPrivate::modifier_buttons = Qt::NoModifier
static

◆ mouse_buttons

Qt::MouseButtons QApplicationPrivate::mouse_buttons = Qt::NoButton
static

◆ mouse_double_click_time

int QApplicationPrivate::mouse_double_click_time = 400
static

◆ move_cursor

QPixmap* QApplicationPrivate::move_cursor

Definition at line 571 of file qapplication_p.h.

Referenced by QApplicationPrivate().

◆ native_modal_dialog_active

bool QApplicationPrivate::native_modal_dialog_active
static

◆ obey_desktop_settings

bool QApplicationPrivate::obey_desktop_settings = true
static

◆ popupWidgets

QWidgetList * QApplicationPrivate::popupWidgets = 0
static

◆ quitOnLastWindowClosed

bool QApplicationPrivate::quitOnLastWindowClosed = true
static

◆ qwsServerCleaner

QWSServerCleaner QApplicationPrivate::qwsServerCleaner

Definition at line 515 of file qapplication_p.h.

◆ RegisterTouchWindow

PtrRegisterTouchWindow QApplicationPrivate::RegisterTouchWindow = 0
static

Definition at line 596 of file qapplication_p.h.

Referenced by QSessionManager::cancel().

◆ runtime_graphics_system

bool QApplicationPrivate::runtime_graphics_system = false
static

◆ scene_list

QList<QGraphicsScene *> QApplicationPrivate::scene_list

Definition at line 387 of file qapplication_p.h.

◆ self

QApplicationPrivate * QApplicationPrivate::self = 0
staticprivate

Definition at line 650 of file qapplication_p.h.

Referenced by qt_cleanup().

◆ session_id

QString QApplicationPrivate::session_id

Definition at line 376 of file qapplication_p.h.

Referenced by process_cmdline().

◆ session_key

QString QApplicationPrivate::session_key

Definition at line 377 of file qapplication_p.h.

Referenced by process_cmdline().

◆ session_manager

QSessionManager* QApplicationPrivate::session_manager

Definition at line 375 of file qapplication_p.h.

◆ set_font

QFont * QApplicationPrivate::set_font = 0
static

Definition at line 435 of file qapplication_p.h.

Referenced by QApplication::~QApplication(), and ~QApplicationPrivate().

◆ set_pal

QPalette * QApplicationPrivate::set_pal = 0
static

Definition at line 423 of file qapplication_p.h.

Referenced by QApplication::~QApplication(), and ~QApplicationPrivate().

◆ SetGestureConfig

PtrSetGestureConfig QApplicationPrivate::SetGestureConfig

Definition at line 607 of file qapplication_p.h.

Referenced by qt_init().

◆ shortcutMap

QShortcutMap QApplicationPrivate::shortcutMap

Definition at line 394 of file qapplication_p.h.

◆ styleOverride

QString QApplicationPrivate::styleOverride
static

◆ styleSheet

QString QApplicationPrivate::styleSheet
static

◆ sys_font

QFont * QApplicationPrivate::sys_font = 0
static

◆ sys_pal

QPalette * QApplicationPrivate::sys_pal = 0
static

◆ toolTipFallAsleep

QBasicTimer QApplicationPrivate::toolTipFallAsleep

Definition at line 390 of file qapplication_p.h.

◆ toolTipGlobalPos

QPoint QApplicationPrivate::toolTipGlobalPos

Definition at line 391 of file qapplication_p.h.

◆ toolTipPos

QPoint QApplicationPrivate::toolTipPos

Definition at line 391 of file qapplication_p.h.

◆ toolTipWakeUp

QBasicTimer QApplicationPrivate::toolTipWakeUp

Definition at line 390 of file qapplication_p.h.

◆ toolTipWidget

QPointer<QWidget> QApplicationPrivate::toolTipWidget

Definition at line 392 of file qapplication_p.h.

◆ touchInputIDToTouchPointID

QHash<DWORD, int> QApplicationPrivate::touchInputIDToTouchPointID

Definition at line 600 of file qapplication_p.h.

◆ UpdatePanningFeedback

PtrUpdatePanningFeedback QApplicationPrivate::UpdatePanningFeedback

Definition at line 610 of file qapplication_p.h.

Referenced by qt_init().

◆ wheel_scroll_lines

int QApplicationPrivate::wheel_scroll_lines
static

◆ widgetCount

bool QApplicationPrivate::widgetCount = false
static

Definition at line 456 of file qapplication_p.h.

Referenced by process_cmdline(), and QApplication::~QApplication().

◆ widgetForTouchPointId

QMap<int, QWeakPointer<QWidget> > QApplicationPrivate::widgetForTouchPointId

Definition at line 580 of file qapplication_p.h.

Referenced by translateRawTouchEvent().


The documentation for this class was generated from the following files: