summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix TouchPoint::lastPos() after TouchPointStationary only events.Jocelyn Turcotte2011-10-171-1/+5
| | | | | | | | | | | | | | | | | lastPos is copied from the last point's position, and the position has to be resolved according the the receiving item's transformation. However, if a QTouchEvent contains only stationary points, it won't be delivered, it's pos()/rect() will still be uninitialized, and the touch point of the next event will be delivered with the uninitialized pos() as it's lastPos(). This patch makes sure that the lastPos() won't be filled with a previous incomplete stationary point state even if the platform is sending us stationary-point-only touch events. Change-Id: Ia7d10423c8fbe78348edbb0a89fbfa66d1b8b5d1 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Remove Q_WS_ and Q_OS_SYMBIAN from QtGui.Friedemann Kleint2011-10-131-115/+0
| | | | | | Change-Id: I2ac3376513c3fbfc81a2e695a73a0d948d2696bc Reviewed-on: http://codereview.qt-project.org/6607 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added Orientation API to QScreen and QWindow.Samuel Rødal2011-10-071-8/+12
| | | | | | | | | | | | QScreen now has a primary and current orientation, and a QWindow can set its orientation as well. The current screen orientation is just a hint to the application. Change-Id: I4635982cfac2d16634d4edd5c6ab78e9d0ac55a4 Reviewed-on: http://codereview.qt-project.org/5988 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com> Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QMouse/Wheel/TouchEvent::modifiers with the XCB back-endSimon Hausmann2011-10-071-4/+4
| | | | | | | | | | | | The modifiers are provided by X and need to be propagated through the QWindowSystemInterface. Change-Id: I127d0b6e9918b558ca15d9302c4cc0cbd94eb757 Reviewed-on: http://codereview.qt-project.org/6244 Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com> Sanity-Review: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Don't default to XCB if it is not enabled.Lincoln Ramsay2011-10-071-1/+5
| | | | | | | | | | | Default to wayland unless it's not enabled. Default to minimal otherwise. Change-Id: I0fa523eae395821a7cb0cabbb27ca073e594246f Reviewed-on: http://codereview.qt-project.org/5945 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QtGui: Add command line arguments to the platform plugin.Friedemann Kleint2011-10-051-1/+27
| | | | | | | | | | | Set -platformargument foo[=bar] as a dynamic property on the native interface. Change-Id: Ica8b25478da0ce9508b90370f15812fd11ff5d13 Reviewed-on: http://codereview.qt-project.org/6031 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added QWindow::isActive() and focus in / out events.Samuel Rødal2011-10-051-5/+17
| | | | | | | | | | | Renamed QGuiApplication::activeWindow() to QGuiApplication::focusWindow(), implemented QWindow::isActive() as a style hint, and added focus in / out events. Change-Id: I71866e76c5a817def3e17bcc20a4fc32081a0e7a Reviewed-on: http://codereview.qt-project.org/5811 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Send key events to the active window when tlw in qpa event is nullLaszlo Agocs2011-09-291-0/+2
| | | | | | | Change-Id: Ie055918276d716b0f4f23b6a9d34c23c5459d960 Reviewed-on: http://codereview.qt-project.org/5777 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Implement support for QGuiApp::setOverrideCursor()Lars Knoll2011-09-281-5/+54
| | | | | | | | | | Properly support application override cursors and move the documentation into the proper place. Change-Id: I0198b38e0d2e7b10f0fcae342b468e7f8341bf02 Reviewed-on: http://codereview.qt-project.org/5562 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Fixed geometry issues.Samuel Rødal2011-09-231-5/+4
| | | | | | | | | | | We need to compare against the window's currently known geometry to know when to send resize and move events. Also make sure at least one resize event is sent, instead of sending one before each expose. Change-Id: Id7ebe4c1c0e723af9198c668a0c736d64efdbf3e Reviewed-on: http://codereview.qt-project.org/5364 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix stale license headers from refactor branchJason McDonald2011-09-151-17/+17
| | | | | | Change-Id: I38cd941202641f50bf632af35165a944d03a20e3 Reviewed-on: http://codereview.qt-project.org/4848 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make QKeySequence work on Mac.Morten Sorvig2011-09-081-1/+1
| | | | | | | | | Replace WS_MAC with OS_MAC. Change-Id: I28a7f7cb65b61f00a3a12f3b257a553b511f85af Reviewed-on: http://codereview.qt-project.org/4353 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
* Refactor the input frameworkLars Knoll2011-09-071-1/+23
| | | | | | | | | | | | | | | | Results of the ongoing workshop in Oslo: QInputPanel will be the application facing interface for controlling the input context as well as querying things like the position of the virtual keyboard. QInputContext is significantly cleaned up and only there as a compatibility API for existing code. Change-Id: Ie8e2ee480930763f414bfaae63247b1fb6500c82 Reviewed-on: http://codereview.qt.nokia.com/4357 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Vesa Rantanen <vesa.rantanen@nokia.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* send resize event when window resizedMatthew Cattell2011-09-071-2/+8
| | | | | | | Change-Id: I4415f1dbdf9bcc96dda10d00c8982a9d4ee433c4 Reviewed-on: http://codereview.qt.nokia.com/4344 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add timestamp to QInputEvent.Laszlo Agocs2011-09-051-0/+5
| | | | | | | | | | | | | | | | The mouse, touch, key events have no timestamp field currently, meaning that the timestamp passed to QWindowSystemInterface's handleMouse, Touch, KeyEvent functions will not be stored in the generated events. The timestamp can be quite valuable in some cases (e.g. when performing filtering of touch events) so losing this information is not desirable. The patch adds a timestamp field to QInputEvent, which is the base for mouse, touch, key, and other events, and also makes QGuiApplication to store the timestamp in the generated events. Change-Id: Icb9de8b238cb341916eac33ce21603f4955baca7 Reviewed-on: http://codereview.qt.nokia.com/4196 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Refactor QMouseEvent to contain the position inside the windowLars Knoll2011-09-011-1/+1
| | | | | | | | | | | | | | Rename the default accessors for positions to localPos, windowPos and screenPos, to be explicit about their use. Introduce a QT_NO_INTEGER_EVENT_COORDINATES define so one can make sure to always use the float based coordinates. Fixup all Qt code to use the correct constructor that specifies all three coordinates. Change-Id: If4bb93b8d1e2eb2440260d99680c468706cfe68f Reviewed-on: http://codereview.qt.nokia.com/4058 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Initialize member variableLars Knoll2011-08-311-1/+2
| | | | | | Change-Id: I165c267b87dc201ed4970d50e39ff7421cbef35f Reviewed-on: http://codereview.qt.nokia.com/3981 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add a QStyleHints class to QtGuiLars Knoll2011-08-311-23/+26
| | | | | | | | | This class encapsulates platform specific style hints like doubleClickInterval or cursorFlashTime. Change-Id: I0d88c47a59d564d8d346642184e5b14e1864cf40 Reviewed-on: http://codereview.qt.nokia.com/3927 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Touch event support for QWindow.Laszlo Agocs2011-08-311-2/+140
| | | | | | Change-Id: I83ddc48a9093856d975b25f0426db96264afeeef Reviewed-on: http://codereview.qt.nokia.com/3920 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* pick up the target window for a mouse event when none is specifiedGunnar Sletta2011-08-301-3/+3
| | | | | | | Change-Id: Iae0402f63f39a2728b94abe68fa22592d97ea9f3 Reviewed-on: http://codereview.qt.nokia.com/3885 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Fix compilation/use correct data type for qt_lastx,y.Friedemann Kleint2011-08-251-12/+8
| | | | | | | Change-Id: I6fdc8dcfb19d7498a1eb8013f75113537ce7a213 Reviewed-on: http://codereview.qt.nokia.com/3594 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Merge branch 'master' into refactorGunnar Sletta2011-08-251-6/+6
| | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication_qpa.cpp src/gui/kernel/qcursor_qpa.cpp src/gui/kernel/qwindowsysteminterface_qpa.cpp src/gui/kernel/qwindowsysteminterface_qpa.h src/gui/kernel/qwindowsysteminterface_qpa_p.h src/gui/text/qtextcontrol.cpp src/plugins/platforms/wayland/wayland.pro src/widgets/accessible/qaccessible2.h src/widgets/widgets/qwidgetlinecontrol_p.h Change-Id: I5e6f4eb184159dccc67e8f13673edb884d179c74
* Implement "quit on last window closed" logic for QWindowGunnar Sletta2011-08-111-0/+44
| | | | | | | Change-Id: Ide33578ad60796f3e267b09be76cda87eaf873d0 Reviewed-on: http://codereview.qt.nokia.com/2827 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Add WindowStateChanged event.Friedemann Kleint2011-08-051-0/+12
| | | | | | | | | Not currently considering activation state. Change-Id: Iea9265d35536947b6cc85639bd9839e9fda69bdf Reviewed-on: http://codereview.qt.nokia.com/2609 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QPlatformFontDatabase: Add default fonts.Friedemann Kleint2011-08-031-1/+3
| | | | | | | | | | | | Add a default font accessor used to initalize QGuiApplication::font(). Add accessor for default font hash providing the defaults for QApplication::font(const char *widgetClassName). Change-Id: Ie4eb6edb251a81e81288ef480ae5550bd1125008 Reviewed-by: Samuel Rødal <sroedal@trolltech.com> Reviewed-on: http://codereview.qt.nokia.com/2567 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Make QPlatformIntegration not have a factory for eventdispatcherJørgen Lind2011-07-281-4/+4
| | | | | | | | | but rather an accessor for the guiThreadEventDispatcher Change-Id: I1b9ba14efc9f338c5a67e3e24ddb0caf76c07413 Reviewed-on: http://codereview.qt.nokia.com/2321 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Make it possible to use QSocketNotifier in Lighthouse pluginsJørgen Lind2011-07-271-4/+17
| | | | | | | | | | | | | The idea is that now the plugin can register the event dispatcher in its constructor, so it can freely use QSocketNotifier or what not. If the plugin choses not to do so, then the createFunction will be called at a later point. Change-Id: I75fb2ee4180d9619ac94e75fbcf1efd7a2deecbc Reviewed-on: http://codereview.qt.nokia.com/2287 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Lighthouse: Provide default plugin.Friedemann Kleint2011-07-251-4/+21
| | | | | | | | | Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Change-Id: I13e78c499f77ac6ad034e61488fc6ef00e2e2be8 Reviewed-on: http://codereview.qt.nokia.com/2124 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add drag and drop events to QWindowSystemInterface.Laszlo Agocs2011-07-251-0/+46
| | | | | | | | | | | For non-desktop platforms these are better suited and are more QPA style than relying purely on QDragManager/QSimpleDrag/sending drag events directly to the windows. Change-Id: Id466830cf83427b3d86925602086a858e8f713e5 Reviewed-on: http://codereview.qt.nokia.com/2084 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix for not calling QPlatformCursor's pointerEvent.Laszlo Agocs2011-07-251-0/+9
| | | | | | | | | | The code to pass mouse events to platform cursors is there in 4.8, however it went missing in refactor. This patch restores it. Change-Id: I7873c892c1ae907fc084d3f00f7d4e5a6293ba4d Reviewed-on: http://codereview.qt.nokia.com/2083 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added workable QScreen API on top of QPlatformScreen.Samuel Rødal2011-07-251-9/+18
| | | | | | | | | | | | | | | | | | | | | QPlatformIntegration::screens() no longer has to be implemented, implementations should call QPlatformIntegration::screenAdded() for each screen instead. This is for being able to support adding screens at run-time later on, by connecting it to a signal in QGuiApplication. The QGuiGLContext API has changed a bit, by not sending in all the parameters in the constructor but instead having a create() function. The createPlatformGLContext() factory in QPlatformIntegration takes a QGuiGLContext * instead of a QSurfaceFormat and a share context, similar to how the window and backing store factory functions work. The XCB plugin has experimental support for connecting to multiple X displays simultaneously, creating one or more QScreen for each. Change-Id: I248a22a4fd3481280710110272c04a30a8021e8f Reviewed-on: http://codereview.qt.nokia.com/2103 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Start porting the Mac menu system to QPA.Morten Sorvig2011-07-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Global changes: qglobal.h: remove code that sets Q_WS_MAC and Q_MAC_USE_COCOA - this is dead code now. Add qt_widget_helpers_mac_p.h/mm which will contain helper functions needed for widgets on Qt 5. Menu-related changes: Set AA_DontUseNativeMenuBar before creating the platform plugin. Change Q_WS_MAC to Q_OS_MAC in the menu code. Remove Q_MAC_USE_COCOA defines and Carbon code paths. Move some qt_mac helper functions only used by the menu system to qmenu_mac.mm. #ifdef out some code paths that require further porting. Native menus are now disabled by default but can be enabled by the QPA plugins that want them by clearing AA_DontUseNativeMenuBar. Since we at compile time don't know which plugin will be loaded the Mac menu code is always included when building on OS X. (The above is currently only relevant for the Cocoa plugin.)
* Make xcb work again after event dispatcher changes.Morten Johan Sorvig2011-06-221-1/+0
| | | | | | The platform plugin/event dispatcher creation order has now been reversed and the event dispatcher cannot be accessed during plugin construciton.
* Add lighthouse event dispatcher API.Morten Sorvig2011-06-221-33/+43
| | | | | | | | | | Platform plugin creation is now moved forward in order to have a platform plugin instance at event dispatcher creation time. Plugins are now responsible for implementing PlatformIntegration::createEventDispatcher and returning an QAbstractEventDispatcher subclass.
* QWindowContext / QWindowFormat refactor.Samuel Rødal2011-06-101-3/+5
| | | | | | | | | | | | | To enable having a single GL context used for multiple drawables we need to de-couple the context class a bit more from the window class in the plugin API. Now contexts are created stand-alone based on a GL format and a share context, and when calling makeCurrent() a desired surface is specified. This maps well to GLX, EGL, Cocoa, AGL, and WGL, which all support this use case. QWindowContext is renamed to QGuiGLContext, and QWindowFormat is renamed to QGuiGLFormat. We have the ability to introduce a pbuffer or similar other offscreen GL drawable abstraction in the future.
* Add QEventDispatcherMac.Morten Sorvig2011-06-091-1/+8
| | | | | Create it directly in QGuiApplication for now, later on we'll move it to the cocoa plugin.
* Cursor support in xcb plug-in.Laszlo Agocs2011-06-081-2/+2
| | | | | | | Custom cursor pixmaps with depth greater than 1 are not yet supported and will be converted to monochrome always. Reviewed-by: Samuel Rødal
* Avoid out of bounds writeLars Knoll2011-06-081-2/+4
| | | | Reviewed-by: Samuel
* Protect against deleted windowsLars Knoll2011-06-071-0/+24
| | | | | | | Check that the window is still there before trying to deliver an event to it. Reviewed-by: Samuel
* Made tst_QWidget::updateWhileMinimized() pass.Samuel Rødal2011-06-061-0/+27
| | | | | | | | | | This requires adding a couple of window system interface events, namely Map, Unmap, and Expose. When a widget is minimized on X11 it is unmapped, and thus update requests should not be delivered. Instead the event will delivered when the widget is mapped, which causes an Expose event to be sent. The Unmap and Expose event thus need to be handled in QWidgetWindow, and Map is also added for the purpose of API symmetry (and for future needs).
* Have a sensible default double click interval.Laszlo Agocs2011-05-311-2/+2
| | | | | | | Having 0 as default would disable double clicks completely which is not really good. Reviewed-by: Samuel Rødal
* Add focus and modal dialog support.Laszlo Agocs2011-05-301-0/+7
| | | | Reviewed-by: Samuel Rødal
* Compile fix for QtGui when configure with -qpa on WindowsOlli Werwolff2011-05-261-1/+1
| | | | Reviewed-by: Friedemann Kleint
* Compile fix for -qpa/Linux.Friedemann Kleint2011-05-231-0/+1
| | | | Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add QGuiApp::topLevelAt and fix visibility flagLars Knoll2011-05-221-0/+21
| | | | | | | Add and remove windows to the list of top level windows. Correctly set the visibility flag for windows and implement a QGuiApplication::topLevelAt() method that uses the QPlatformScreen.
* Added QGuiApplication::activeWindow().Samuel Rødal2011-05-201-2/+8
|
* move files in src/gui into their final locationsLars Knoll2011-05-111-0/+1059
| | | | | Rename the guikernel subdir to kernel and guiutil to util.
* split kernel/ up according to the future library splitLars Knoll2011-05-041-925/+0
| | | | | | | Create a guikernel/ directory that contains the files that'll go into libQtGui. What remains in kernel/ will go into QtWidgets. In addition to that image/, painting/ and text will end up int QtGui.
* move keyboardInputLocale and keyboardInputDirection into QGuiApplicationLars Knoll2011-05-041-0/+25
|
* Remove more QApp dependenciesLars Knoll2011-05-041-0/+11
| | | | | | platformIntegration() lives in QGuiApplication QFont and QFontDatabase can live with QGuiApp only as well.