45 #if defined(Q_OS_BLACKBERRY) 48 #if !defined(QT_NO_GLIB) 54 #include "private/qcursor_p.h" 57 #include "private/qwidget_p.h" 58 #include "private/qevent_p.h" 65 #include <QPlatformCursor> 67 #include <QWindowSystemInterface> 69 #include <QPlatformIntegration> 98 QApplicationPrivate::processMouseEvent(static_cast<QWindowSystemInterfacePrivate::MouseEvent *>(e));
101 QApplicationPrivate::processWheelEvent(static_cast<QWindowSystemInterfacePrivate::WheelEvent *>(e));
104 QApplicationPrivate::processKeyEvent(static_cast<QWindowSystemInterfacePrivate::KeyEvent *>(e));
107 QApplicationPrivate::processTouchEvent(static_cast<QWindowSystemInterfacePrivate::TouchEvent *>(e));
110 QApplicationPrivate::processGeometryChangeEvent(static_cast<QWindowSystemInterfacePrivate::GeometryChangeEvent*>(e));
113 QApplicationPrivate::processEnterEvent(static_cast<QWindowSystemInterfacePrivate::EnterEvent *>(e));
116 QApplicationPrivate::processLeaveEvent(static_cast<QWindowSystemInterfacePrivate::LeaveEvent *>(e));
119 QApplicationPrivate::processActivatedEvent(static_cast<QWindowSystemInterfacePrivate::ActivatedWindowEvent *>(e));
122 QApplicationPrivate::processWindowStateChangedEvent(static_cast<QWindowSystemInterfacePrivate::WindowStateChangedEvent *>(e));
125 QApplicationPrivate::processCloseEvent(
126 static_cast<QWindowSystemInterfacePrivate::CloseEvent *>(e));
129 QApplicationPrivate::reportScreenCount(
130 static_cast<QWindowSystemInterfacePrivate::ScreenCountEvent *>(e));
133 QApplicationPrivate::reportGeometryChange(
134 static_cast<QWindowSystemInterfacePrivate::ScreenGeometryEvent *>(e));
137 QApplicationPrivate::reportAvailableGeometryChange(
138 static_cast<QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *>(e));
141 QApplicationPrivate::reportLocaleChange();
144 QApplicationPrivate::processPlatformPanelEvent(
145 static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e));
148 qWarning() <<
"Unknown user input event type:" << e->
type;
175 #if defined(Q_OS_BLACKBERRY) 178 #if !defined(QT_NO_GLIB) 194 bool block_event =
false;
195 bool paint_event =
false;
200 if (!static_cast<QWSFocusEvent*>(
event)->simpleData.get_focus)
216 if ((block_event || paint_event) && top->
parentWidget() == 0)
228 qt_modal_stack->
insert(0, widget);
234 if (qt_modal_stack && qt_modal_stack->
removeAll(widget)) {
235 if (qt_modal_stack->
isEmpty()) {
279 q->sendEvent(fw, &e);
367 #ifndef QT_NO_WHEELEVENT 436 qApp->d_func()->cursor_list.prepend(cursor);
442 if (
qApp->d_func()->cursor_list.isEmpty())
444 qApp->d_func()->cursor_list.removeFirst();
448 #endif// QT_NO_CURSOR 460 QWidget *w = (*screen)->topLevelAt(pos);
464 while (screen != end) {
465 if ((*screen)->geometry().contains(pos))
466 return (*screen)->topLevelAt(pos);
492 if (!QApplicationPrivate::platform_integration) {
508 delete QApplicationPrivate::platform_integration;
509 QApplicationPrivate::platform_integration = 0;
514 for (
int i = 0; i < pluginList.
count(); ++i) {
516 qDebug() <<
"init_plugins" << i << pluginSpec;
517 int colonPos = pluginSpec.
indexOf(
':');
524 qDebug() <<
" created" << plugin;
528 #ifndef QT_NO_QWS_INPUTMETHODS 541 #endif // QT_NO_QWS_INPUTMETHODS 553 p = strrchr(argv[0],
'/');
560 #ifdef QT_QPA_DEFAULT_PLATFORM_NAME 561 platformName = QT_QPA_DEFAULT_PLATFORM_NAME;
564 if (!platformNameEnv.
isEmpty()) {
565 platformName = platformNameEnv;
570 int j = argc ? 1 : 0;
571 for (
int i=1; i<
argc; i++) {
572 if (argv[i] && *argv[i] !=
'-') {
577 if (arg ==
"-fn" || arg ==
"-font") {
580 }
else if (arg ==
"-platformpluginpath") {
583 }
else if (arg ==
"-platform") {
585 platformName = argv[i];
586 }
else if (arg ==
"-plugin") {
588 pluginList << argv[i];
594 if (j < priv->argc) {
615 qApp->setObjectName(appName);
617 #ifndef QT_NO_QWS_INPUTMETHODS 640 void QApplication::setMainWidget(
QWidget *mainWidget)
683 check = check << 1) {
684 if (check & stateChange) {
713 mouseWindow =
qApp->activePopupWidget();
715 implicit_mouse_grabber.
clear();
732 if (!mouseWindow && !implicit_mouse_grabber)
735 if (mouseWindow && mouseWindow != tlw) {
741 QWidget *mouseWidget = mouseWindow;
751 implicit_mouse_grabber = mouseWidget;
755 }
else if (implicit_mouse_grabber) {
756 mouseWidget = implicit_mouse_grabber.
data();
757 mouseWindow = mouseWidget->
window();
758 if (mouseWindow != tlw)
765 localPoint = mouseWidget->
mapFrom(mouseWindow, localPoint);
769 implicit_mouse_grabber.
clear();
772 if (mouseWidget != qt_last_mouse_receiver) {
774 qt_last_mouse_receiver = mouseWidget;
794 #ifndef QT_NO_CONTEXTMENU 799 #endif // QT_NO_CONTEXTMENU 842 mouseWidget = mouseWindow;
845 qDebug() <<
"modal blocked wheel event" << mouseWindow;
902 qt_last_mouse_receiver = e->
enter.
data();
914 qt_last_mouse_receiver = 0;
935 bool isResize = cr.
size() != newRect.
size();
936 bool isMove = cr.topLeft() != newRect.
topLeft();
991 for (
int i = list.
size() - 1; i >= 0; --i) {
994 w->d_func()->setFullScreenSize_helper();
996 w->d_func()->setMaxWindowState_helper();
1000 void QApplicationPrivate::reportAvailableGeometryChange(
1015 for (
int i = list.
size() - 1; i >= 0; --i) {
1018 w->d_func()->setFullScreenSize_helper();
1020 w->d_func()->setMaxWindowState_helper();
1024 void QApplicationPrivate::reportLocaleChange()
static int keyboardInputInterval()
static QWidget * main_widget
static QApplicationPrivate * self
The QApplication class manages the GUI application's control flow and main settings.
static QColormap instance(int screen=-1)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QKeyEvent class describes a key event.
Qt::KeyboardModifiers modifiers
This property holds the keyboard modifier flags that existed immediately before the event occurred...
QList< QTouchEvent::TouchPoint > points
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
static void beep()
Sounds the bell, using the default volume and sound.
QWeakPointer< QWidget > leave
static bool versionSupported()
The QCursor class provides a mouse cursor with an arbitrary shape.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
QString language()
This function must be implemented in any subclasses to return a language code (e. ...
QList< QWidget * > QWidgetList
The QWheelEvent class contains parameters that describe a wheel event.
static void initializeWidgetPaletteHash()
The QByteArray class provides an array of bytes.
static QWidget * activeWindow()
Returns the application top-level window that has the keyboard input focus, or 0 if no application wi...
void initializeMultitouch_sys()
static Qt::MouseButtons buttons
static int wheel_scroll_lines
void createEventDispatcher()
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
static void init_plugins(const QList< QByteArray > pluginList)
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
static bool testAttribute(uint flag)
void insert(int i, const T &t)
Inserts value at index position i in the list.
static bool qt_try_modal(QWidget *widget, QEvent::Type type)
static QWidget * active_window
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static void cleanup()
Internal function that cleans up the font system.
int count(const T &t) const
Returns the number of occurrences of value in the list.
void closePopup(QWidget *popup)
static int cursorFlashTime()
static void cleanup_platform()
Qt::MouseButtons buttons
This property holds the mouse buttons pressed when the event was generated.
The QString class provides a Unicode character string.
bool isNull() const
Returns true if this object is holding a reference to a null pointer.
bool isComposing() const
This function indicates whether InputMethodStart event had been sent to the current focus widget...
void cleanupMultitouch_sys()
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QObject class is the base class of all Qt objects.
static int wheelScrollLines()
QWeakPointer< QWidget > tlw
int key
This property holds the code of the key that was pressed or released.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
static int keyboard_input_time
Q_CORE_EXPORT void qDebug(const char *,...)
void append(const T &t)
Inserts value at the end of the list.
static QList< WindowSystemEvent * > windowSystemEventQueue
static QObject * create(const QString &, const QString &)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QMoveEvent class contains event parameters for move events.
static bool isEmpty(const char *str)
static void initialize()
Internal function that initializes the font system.
static int openPopupCount
static QWidgetList * popupWidgets
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
static void clear()
Removes all pixmaps from the cache.
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event)
static int mouse_double_click_time
The QResizeEvent class contains event parameters for resize events.
Q_CORE_EXPORT void qWarning(const char *,...)
static Qt::MouseButton mousePressButton
static void setKeyboardInputInterval(int)
static bool animate_combo
static void alert(QWidget *widget, int duration=0)
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static int mouse_double_click_distance
static void setActiveWindow(QWidget *act)
Sets the active window to the active widget in response to a system event.
int indexOf(char c, int from=0) const
Returns the index position of the first occurrence of the character ch in the byte array...
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
static QWidget * topLevelAt(const QPoint &p)
Returns the top-level widget at the given point; returns 0 if there is no such widget.
QString identifierName()
This function must be implemented in any subclasses to return the identifier name of the input method...
QPointer< QWidget > qt_last_mouse_receiver
static bool startingUp()
Returns true if an application object has not been created yet; otherwise returns false...
static void enterModal_sys(QWidget *)
The QMouseEvent class contains parameters that describe a mouse event.
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
QWeakPointer< QWidget > activated
const char * constData() const
Returns a pointer to the data stored in the byte array.
static bool animate_tooltip
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...
static bool tryModalHelper(QWidget *widget, QWidget **rettop=0)
Q_CORE_EXPORT void qFatal(const char *,...)
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
static void setCursorFlashTime(int)
static bool isEffectEnabled(Qt::UIEffect)
Returns true if effect is enabled; otherwise returns false.
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
QString & append(QChar c)
The QWindowStateChangeEvent class provides the window state before a window state change...
Type
This enum type defines the valid event types in Qt.
static QAbstractEventDispatcher * eventDispatcher
static QInputContext * inputContext
static void init_platform(const QString &name, const QString &platformPluginPath)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static bool animate_toolbox
static ulong mousePressTime
The QPoint class defines a point in the plane using integer precision.
static void setWheelScrollLines(int)
QDummyInputContext(QObject *parent=0)
T & last()
Returns a reference to the last item in the list.
int size() const
Returns the number of items in the list.
The QRect class defines a rectangle in the plane using integer precision.
QWeakPointer< QWidget > topLevel
void reset()
This function can be reimplemented in a subclass to reset the state of the input method.
static void dispatchEnterLeave(QWidget *enter, QWidget *leave)
void clear()
Clears this QWeakPointer object, dropping the reference that it may have had to the pointer...
int y() const
Returns the y coordinate of this point.
static void setOverrideCursor(const QCursor &)
Use changeOverrideCursor(cursor) (if replace is true) or setOverrideCursor(cursor) (if replace is fal...
QWeakPointer< QWidget > widget
QWidgetList * qt_modal_stack
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
static void setDoubleClickInterval(int)
int x() const
Returns the x coordinate of this point.
QTouchEvent::DeviceType devType
static void restoreOverrideCursor()
Undoes the last setOverrideCursor().
The QInputContext class abstracts the input method dependent data and composing state.
QWeakPointer< QWidget > enter
static void translateRawTouchEvent(QWidget *widget, QTouchEvent::DeviceType deviceType, const QList< QTouchEvent::TouchPoint > &touchPoints)
static void leaveModal_sys(QWidget *)
static const KeyPair *const end
The QEvent class is the base class of all event classes.
void qt_init(QApplicationPrivate *priv, int type)
static int doubleClickInterval()
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...
The QFocusEvent class contains event parameters for widget focus events.
static void setEffectEnabled(Qt::UIEffect, bool enable=true)
Enables the UI effect effect if enable is true, otherwise the effect will not be used.
void openPopup(QWidget *popup)
static bool isNull(const QVariant::Private *d)
QWeakPointer< QWidget > tlw
The QList class is a template class that provides lists.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
static int cursor_flash_time
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.