summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make accessible interfaces private for Qt 5.0Jan-Arve Saether2012-02-281-1/+1
| | | | | | | | | Since we're not yet confident if they serve their purpose well enough, we have decided to make them internal so that we are free to tune them later Change-Id: Id79d154e0537aca07303afea5d057cfcb0773384 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fleshed out the QWindow documentation to be less sparse.Samuel Rødal2012-02-231-53/+541
| | | | | Change-Id: Ia3873687a2c3e0dd85c56e4f9e34d2e194e2ff50 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Remove QPlatformIntegration/QPlatformTheme from QGuiAppPrivate.Friedemann Kleint2012-02-201-0/+1
| | | | | | | Forward-declare instead. Change-Id: I3851994e8bc05b389e94e948478339ba33d521c1 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* qpa: Verify that the platform returns a WId that is not WId(0)Holger Hans Peter Freyther2012-02-201-1/+5
| | | | | | | | | | | This is motivated by visiting a customer that re-implemented the ::winId method and returned WId(0) that resulted in a crash. Currently there is only a comment inside the implementation of the ::winId default implementation. Add a note to the API documentation, add a Q_ASSERT to check if our assumption holds true. Change-Id: I8607a4efc4f561f7849c976cd2454f6fbcb20eaa Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Introduced QWindow::isExposed().Gunnar Sletta2012-02-181-0/+32
| | | | | | | | | | | The visible property along with show/hideEvent tracks the windows visibility from the application perspective and is really a request. The exposeEvent() along with the isExposed() accessor is used to notify the application of the actual state of the window in the windowing system. Change-Id: I7f5b7ed74a168e34aaa21ce0ae9042ddfb0bf6d8 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed API in QWindow: visible() -> isVisible().Samuel Rødal2012-02-171-2/+8
| | | | | | Change-Id: I14706abb8441c153f738563cb1a46205fdb2dae6 QWindow::visible() did not follow the API guidelines. Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix ref counted window close handling.Stephen Kelly2012-02-161-19/+5
| | | | | | | | | | Instead of refcounting QWindow visibility, we ask the Application subclass whether quitting is appropriate. Task-Id: QTBUG-24120 Change-Id: Idd19cc1a3e5742fddded89c7638aaaa5e47c568d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Move the removal of the Quit event to QWindow.Stephen Kelly2012-02-151-0/+3
| | | | | Change-Id: If524127ba9dab9ef065aaf4079294295eef8e49b Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Handle TouchCancel in gui and widgetsLaszlo Agocs2012-02-101-0/+1
| | | | | Change-Id: I31739840348d88ae408ac1aae2399f6328ccdd43 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Destroy the QWindow children in destroy() instead of close()Laszlo Agocs2012-02-061-10/+9
| | | | | | | | | | | | | | | | When closing a window, destroy() ensures a setVisible(false) call only for the window itself, not for other windows parented to it. With the new quit lock ref feature this breaks code that creates a fake root window parented to the main, visible window. (for example the xcomposite backends of qtwayland do this) Such apps do not anymore exit after closing their window because the children do not receive a deref due to setVisible not getting called. (At that point. It would get called after exiting the event loop but that never happens due to the refcounting) Change-Id: I124737c80ad59600ddc79261100f3904af0f410d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add the event loop quitlock feature to QtCore.Stephen Kelly2012-01-311-0/+20
| | | | | | | | | | | | | | | | A feature of a ref-counted quit (managed by a quit-lock class) is added to both QEventLoop and QCoreApplication. This allows, for example, an event loop to quit() when there is no more work for it to do. quitOnLastWindowClosed is implemented in terms of the refcount in QCoreApplication so that jobs can be completed before the application quits. Change-Id: I14c8f4e7ee12bbf81a6e5849290d4c8ff37fa110 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Add native event filters to Windows, forward to Widgets.Friedemann Kleint2012-01-301-0/+8
| | | | | | | Use prototypically for qwizard_win.cpp. Change-Id: I075e81ae1bc3d62d9f27e51c73c800ffd71cbcd6 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QGuiApplication::focusObject() to replace QInputPanel::inputItem()Pekka Vuorela2012-01-271-0/+7
| | | | | | | | | | | * Deprecated QInputPanel::inputWindow() which is already just returning QGuiApplication::activeWindow() * Deprecated QInputPanel::inputItem() and introduced QGuiApplication::focusObject(). Input methods can check input method support by Qt::ImEnabled query. Change-Id: I70a9c1c3f79aadb75c839d0489a9428f7a221df5 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Implement QWindow::close()Anselmo L. S. Melo2012-01-271-2/+22
| | | | | | | Implement the public slot QWindow::close() and add the correspondent test. Change-Id: If3f07cce3b26640f06fc52d0e4dca875d9894b3d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Made QWindow::currentOrientation() a property.Samuel Rødal2012-01-261-5/+9
| | | | | | | | | | | | | | To match the previous QWindow::orientation() property which can be useful to access from QML. Also, removed the automatic translation of Qt::PrimaryOrientation to QScreen::primaryOrientation() on the QWindow level, as it leads to a lot of complexity regarding the QWindow::contentOrientationChanged() signal, and makes it hard to distinguish between the case where the window's orientation follows that of the screen, and the case where the orientation just happens to be set to that of the screen. Change-Id: I6950d1337b7f929815eff1328181855090d8066b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Made window orientation API more flexible.Samuel Rødal2012-01-241-23/+79
| | | | | | | | | | | | | | | Previously we only had QWindow::setOrientation() which was a hint about the orientation the window's contents were rendered in. However, it's necessary to separate between the orientation corresponding to the window buffer layout and orientation of the contents. A game for example might typically want to use a landscape buffer even on a portrait device. Thus, we replace QWindow::orientation() with QWindow::reportContentOrientationChange() and QWindow::requestWindowOrientation(). Change-Id: I1f07362192daf36c45519cb05b43ac352f1945b5 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make it possible to compile with -no-opengl.Andreas Holzammer2012-01-241-0/+2
| | | | | | | | | | | | | This takes out the dependency to the header files of OpenGl. The ifdef QT_NO_OPENGL in the opengl headers are needed, as qmake adds depends in the makefiles for all GUI headers. Task-number: QTBUG-23207 Change-Id: If31448ee35fd8c39194c7cb7d62273fbc6def883 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Docs: Fix typo in the QWindow class documentationAnselmo L. S. Melo2012-01-201-1/+1
| | | | | | | | It was 'windw' instead of 'window' Change-Id: I3a7b361a22e4ea09ee1fb3d9b551c1a88d401ff1 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Added application flags to translate between touch and mouse events.Samuel Rødal2012-01-131-34/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current way we do it of having the platform or touch plugin send both mouse and touch events is not ideal. There's no good way to write an application that works sanely both on a touch-only device and on a desktop except by restricting yourself to only handling mouse events. If you try to handle touch events you don't get any events at all on desktop, and if you try to handle both, you end up getting duplicate events on touch devices. Instead, we should get rid of the code in the plugins that automatically sends mouse events translated from touch events. This change enables that by making the behaviour fully configurable in QtGui. Two new application attributes are added to explicitly say whether unhandled touch events should be sent as synthesized mouse events and vice versa, and no duplicates are automatically sent as the current situation. Synthesized mouse events are enabled by default. We also get rid of the QTouchEvent::TouchPoint::Primary flag, which was only used to signal that the windowing system automatically generated mouse events for that touch point. Now we only generate mouse events from the first touch point in the list. Change-Id: I8e20f3480407ca8c31b42de0a4d2b319e1346b65 Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Make show() default to sane sizing behaviour based on the platform.Samuel Rødal2012-01-121-4/+18
| | | | | | | | | | | | | | | | Traditionally it's been hard to write a Qt app that behaves sanely across embedded and desktop platforms, i.e. defaults to fullscreen on embedded and non-fullscreen on desktop. For Qt 5 we can fix this by making the behaviour of the default QWindow::show() be customizable by the platform plugin. If the application developer wants to override this behaviour he can still use the explicit showFullScreen(), showNormal() etc functions. Change-Id: I26a907b404058e345d841c818daefbb57a26d3fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add touchEvent() virtual to QWindow.Laszlo Agocs2011-12-121-0/+9
| | | | | | | | | | | Unlike keyPressEvent(), mousePressEvent(), etc. the touch events had no equivalent so one had to fall back to reimplementing event() or using an event filter. This is now corrected by introducing touchEvent(). Touch events are finally becoming a first-class citizen in Qt 5. Change-Id: Ia2044030154fd5b1b5384f08a3cb1749b798435f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added minimal class docs for QWindow to make it visible.Gunnar Sletta2011-12-021-0/+20
| | | | | Change-Id: Ibed2279ba5454547fb4060005e805a11221b3732 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added screenChanged() signal and handle screen destruction in QWindow.Samuel Rødal2011-11-291-2/+24
| | | | | | | | It can be useful to get a signal when the QScreen changes, for example when having bindings to QScreen properties in QML. Change-Id: I919dd12c656485b28b393aec5eedac4c01593afc Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Add some properties to QWindowAlan Alpert2011-11-221-0/+18
| | | | | | | | x,y,width,height,visible and orientation Includes slot setters and notify signals for maximal QML compatibility. Change-Id: I124399093c00f8ad1485d4fbae816dfbe3027eff Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Get rid of unused inputMethodEvent functionJoona Petrell2011-11-211-4/+0
| | | | | | | | | In Qt5 input method events are meant to be sent directly to QInputPanel::inputItem() instead of the focused QWindow. Change-Id: Idc8fe458973f066b578f6374ca33ce6f950bf9cf Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Adding a "helper assert" for when you can create QWindowJørgen Lind2011-11-151-0/+5
| | | | | | | | maybe if your trying to instansiate a QWindow before the QApplication has been instansiated. Change-Id: I68ed4ad1dbdfedc242a7cb27c1381d50a3d3dfa4 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QWindow: Re-create platform window only if screen actually changes.Friedemann Kleint2011-10-221-6/+10
| | | | | Change-Id: I3b7dd8b1307aa3cc9357dca861ea407644c5a2e9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add virtual QWindow::focusObject() methodLars Knoll2011-10-221-0/+9
| | | | | | | | | | The method allows to retrieve the object that currently has the input focus inside the Window. This is e.g. required to correctly determine the context for keyboard shortcuts. Change-Id: I9e05ef62717973bac275ce34cc70fb86aa2d1e5b Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added Orientation API to QScreen and QWindow.Samuel Rødal2011-10-071-0/+35
| | | | | | | | | | | | 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>
* Added QWindow::isActive() and focus in / out events.Samuel Rødal2011-10-051-5/+67
| | | | | | | | | | | 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>
* Implement showFullScreen, showNormal, and showMaximized/Minimized in QWindow.Alexis Menard2011-10-041-4/+9
| | | | | | | | | | The implementation was just missing to call the proper APIs. Merge-request: 65 Change-Id: I52f7825360bf55d37762421562484af684bf2dc8 Reviewed-on: http://codereview.qt-project.org/5986 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added QWindow::requestedFormat()Gunnar Sletta2011-10-031-0/+15
| | | | | | | Change-Id: I9e69ddd8ceefeda87216fb3d2507c40bc7220cf5 Reviewed-on: http://codereview.qt-project.org/5846 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Refactor accessibility for Qt5Jan-Arve Saether2011-09-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | * Moved most stuff to gui\accessible * Moved widget-specific stuff to widgets\accessible * Moved platform-specific code to either the bridge plugin (this was already the case) or to the platform plugin. * Added several classes and functions. These have not yet gone through an API review. The plan is to do that in a later commit. Classes: - QPlatformAccessibility - QWindowsAccessibility Functions: - QWindow *QAccessibleInterface::window(); - QPlatformAccessibility *QPlatformIntegration::accessibility() * The bridge code can now either be a plugin or integrated into the platform plugin * Mac accessibility is left out for now. Unix "should still work" (tm). These platforms should be fixed soon. Change-Id: Ib49ffa73b647ee0af90864544c2769440157f562 Reviewed-on: http://codereview.qt-project.org/5330 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Implemented QWidget's move() vs setGeometry() distinction in QWindow.Samuel Rødal2011-09-231-0/+60
| | | | | | | | | | | | | | QWidget's move() sets the position of the window including the window frame, unlike setGeometry(). There was no equivalent for this in QWindow, so several QWidget auto-tests were failing. Now we add setFramePos() to achieve the same purpose in QWindow. This fixes tst_QWidget::windowState(), which uses move(). Change-Id: I9a3e558bd615a8f0234cc3dd94fbb2bf5ecbc148 Reviewed-on: http://codereview.qt-project.org/5405 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fixed geometry issues.Samuel Rødal2011-09-231-0/+8
| | | | | | | | | | | 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>
* Return the correct geometryLars Knoll2011-09-211-0/+2
| | | | | | | | | | | | | When the platform window is created, it is the authorative source for geometry information. It would however be better if we could completely avoid duplicated places for the geometry data. Change-Id: Id90b24b9c40acb57f3d11b8b927292c06bac335e Reviewed-on: http://codereview.qt-project.org/5258 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Say hello to QWindow::accessibleRoot()Jan-Arve Saether2011-09-191-0/+9
| | | | | | | Change-Id: I1efa71f01f8af46c9addf2aae21e4b6fc086ad2e Reviewed-on: http://codereview.qt-project.org/5087 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@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>
* Fix try #2 at QSurface missing a virtual destructorJani Uusi-Rantala2011-09-061-0/+4
| | | | | | | | | | All virtual base classes with accessible destructor should declare the destructor as virtual too. Change-Id: I2b07c7e824612af072d7802095d958dca8cc34c8 Reviewed-on: http://codereview.qt.nokia.com/4274 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Copy core GL functionality to QtGui with QGL -> QOpenGL naming.Samuel Rødal2011-08-291-2/+2
| | | | | | Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855 Reviewed-on: http://codereview.qt.nokia.com/3710 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QWindow::mapToGlobal/mapFromGlobal and move()Gunnar Sletta2011-08-291-0/+35
| | | | | | | Change-Id: If1909b9ce468a8708cb25d5a2fbe8ebd90bd958a Reviewed-on: http://codereview.qt.nokia.com/3702 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Preliminary change to get resizeEvents for QWindow::resize() callsGunnar Sletta2011-08-241-1/+2
| | | | | | | Change-Id: I43e1d7fb98f1b20939dba8cdccffa4dcb99a7369 Reviewed-on: http://codereview.qt.nokia.com/3453 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fixed empty if statement in QWindow.cppOlli Werwolff2011-08-221-1/+1
| | | | | | | Change-Id: Ib324eb30da1e16f01b9655ed293244fb50b621b8 Reviewed-on: http://codereview.qt.nokia.com/3289 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Implement "quit on last window closed" logic for QWindowGunnar Sletta2011-08-111-2/+30
| | | | | | | 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>
* Made QWindow::setVisible() send show and hide events.Samuel Rødal2011-08-101-2/+19
| | | | | | | Change-Id: Ideae15f7bd6801d7afe2354627c0893b0b6a32ca Reviewed-on: http://codereview.qt.nokia.com/2741 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Added some convenience to QWindowGunnar Sletta2011-08-051-0/+13
| | | | | | | Change-Id: I367f5e3f586661322184cfa5f7653814569cb6e3 Reviewed-on: http://codereview.qt.nokia.com/2611 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QWindow: Do not call setters for window state, type etc in creation.Friedemann Kleint2011-07-261-7/+0
| | | | | | | | | | | | | | Remove the need to do housekeeping and comparison of window types, etc in the platform window setters. They can safely assume the flags have really changed and something (potentially recreating the window) has to be done. createPlatformWindow() must then query all parameters from QWindow and apply them. Change-Id: I497060ba46a955cad1fa3cbb5eb91438a420b80e Reviewed-on: http://codereview.qt.nokia.com/2198 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>