summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformintegration.h
Commit message (Collapse)AuthorAgeFilesLines
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* iOS: Implement support for QApplication::beep()Tor Arne Vestbø2015-12-171-0/+2
| | | | | | | | | | | | | Vibrates the device or plays an alert sound on devices that do not support vibration. The other implementations of beep() have been moved to QPlatformIntegration as a proper API instead of having them as invokables in QPlatformNativeInterface. Change-Id: Ic597dbef04b46d49862b070e78ddfc0d763829a2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
* Avoid dynamic switching between backingstore composition pathsLaszlo Agocs2015-12-011-1/+2
| | | | | | | | | | | | | | | | | | Make it opt-in because doing a normal backingstore flush does not seem to work on Cocoa once we use OpenGL on the window. Windows and Linux should be able to cope with this. This means that platforms outside Windows and Linux will continue to have the problem of having GL-based compositing enabled for ever after having a QOpenGL/QuickWidget shown in the window once, but the issue is most prevalent on Windows anyway, OS X machines can deal with OpenGL better in general. Task-number: QTBUG-49172 Change-Id: I30fd2efa95cc4f6eed9cf7f7613d0750355c775c Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Notify when the primary screen changesAleix Pol2015-09-081-0/+4
| | | | | | | | | | | | | Makes it possible to notify that the QGuiApplication::primaryScreen has changed. XCB backend adopts the new API, as it was accessing QGuiApplication private API directly. Change-Id: Icde05c44138265f865fa42d2cd6974c552fdc5e2 Task-number: QTBUG-38404 Task-number: QTBUG-40659 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Expose ItemViewActivateItemOnSingleClick in QStyleHintsEike Hein2015-04-101-1/+2
| | | | | | | | | | | | | | | | | | | | This completes support for ItemViewActivateItemOnSingleClick in QPlatformIntegration and exposes the setting in QStyleHints. Based on the review process, the public name used is 'singleClickActivation' for brevity, as well as to avoid con- fusion over alluding to "item views" in the Qt Quick context. KDE Plasma intends to use this via Qt.styleHints to have Qt Quick-based UI correctly implement the global single vs. double click user preference for item activation. [ChangeLog][QtGui] Added QStyleHints::singleClickActivation to access whether the platform expects item activation to occur on single clicks rather than double clicks. Change-Id: I0916e9e68c3a157f95053da8227b2612803653f7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Add a means to set the application icon where supportedAndy Shaw2015-04-101-2/+3
| | | | | | | | | | | | | On OS X the application icon can be changed at runtime, so this adds a way to set this via the QPlatformIntegration. [ChangeLog][OS X] QApplication::setWindowIcon now changes the icon for the application in the dock. Task-number: QTBUG-43999 Change-Id: Ice298c0bd52f10f4866f37c6d3f20cf5419b7a1b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* Don't replay mouse press event which closes a popup on X11Alexander Volkov2015-03-251-1/+2
| | | | | | | | | | | Add a new style hint to QPlatformIntegration: ReplayMousePressOutsidePopup. Return false for it in the xcb plugin. This commit restores the behavior which was in Qt 4. Task-number: QTBUG-34814 Change-Id: I19fee762395a51475cc67b52b368c70679ca736b Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Decide whether to synthesize mouse events on a per device basisAlexander Volkov2015-02-251-1/+0
| | | | | | | | | | | | | | | | | | | | | Currently Qt uses the QPlatformIntegration::StyleHint SynthesizeMouseFromTouchEvents to check whether to synthesize mouse events from touch events. But not only platform plugins can produce touch events, they can be created by e.g. QTest::touchEvent() and in this case we almost definitely need synthesizing regardless of the platform. This commit introduces a QTouchDevice::MouseEmulation capability which replaces use of the QPlatformIntegration::SynthesizeMouseFromTouchEvents. So it's possible to pass QTouchDevice without this capability to QTest::touchEvent() and be sure that mouse events will be synthesized. Notice that touch pads always emulate mouse events. As a result we can activate some tests which were disabled for specific platform configurations by commits 6c1670d8c273819435867c42725c0db0eee597dc and e9760f1559361c39f269fb89f1ebd01f6ee8378d. Change-Id: Idc82fa4007a095fc1cb5934979361b0023d2b793 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Ensure QGuiApplicationPrivate::screen_list is correctly populatedSandro Mani2015-02-251-1/+1
| | | | | | | | | | Ensure QGuiApplicationPrivate::screen_list always contains at least one screen, and that the first item (returned by QGuiApplication::primaryScreen) is always the current primary screen Task-number: QTBUG-42985 Change-Id: I08b880b3e94387f28230ed5fc738bceea943bad3 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Expose TabFocusBehavior in QStyleHintsLiang Qi2015-02-121-1/+2
| | | | | | | | | | TabAllWidgets in QPlatformTheme is replaced by TabFocusBehavior. [ChangeLog][QtGui] Expose TabFocusBehavior in QStyleHints Change-Id: Iafaad7c6a5c6bc888d1e124e6ddcdbdc46f37b1c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Revert "Introducing QPlatformHardwareCompositor."Gunnar Sletta2015-02-061-3/+0
| | | | | | | | | | I'm having seconds thoughts about this api. Better to not commit to it just yet. This reverts commit ebdd4a0ba7daf74b11f716d291a97f7cd28c2aca. Change-Id: I9725e3172b0166b56364a34db246eabb685e855d Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Introducing QPlatformHardwareCompositor.Gunnar Sletta2015-01-171-0/+3
| | | | | | | | | | Can be used by applications to send hardware buffers directly to the hardware compositor, if available. The primary usecase right now will be from QtWayland to 2D composition of surface by bypassing the OpenGL composition. Change-Id: Ibdcdcc744c34869d3abbc11aad448a755f87161f Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Add a function for QPA plugins to explicitly destroy QScreensGiulio Camuffo2014-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously QPlatformScreen was automatically deleting its QScreen in ~QPlatformScreen(). That means that we cannot use QScreen's methods when the screen is being removed, because doing so would call virtual methods of QPlatformScreen. By that point the QPlatformScreen subclass object does not exist anymore, and we call the default implementation instead of the subclassed one, or get a crash for the pure virtual methods. This happens for example when removing a screen which contains a QWindow with some QML item using QQuickScreenAttached. This patch adds a QPlatformIntegration::destroyScreen() function, which deletes the QScreen and later the QPlatformScreen. ~QPlatformScreen will still delete the QScreen if it was not deleted with destroyScreen(), so code not ported to the new approach will continue to work as before, with only a warning added. Task-number: QTBUG-41141 Change-Id: Ie4a03dee08ceb4c3e94a81875411f6f723273fe1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* EGLFS: Fix plugin destruction (again)Louai Al-Khanji2014-10-031-0/+1
| | | | | | | | | The previous patch was flawed since by the time the QEglPlatformIntegration destructor was called the virtual function table did not point to the methods in QEglFsPlatformIntegration any more. Change-Id: I310e5e3e734a22b44645ba912b579f193bcfae86 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Make QOpenGLFunctions able to resolve everythingLaszlo Agocs2014-03-061-1/+2
| | | | | | | | | | | | | At least if the platform plugin's QPlatformOpenGLContext implementation supports it. This completes the QOpenGLFunction changes necessary for dynamic loading of the OpenGL implementation. Everything else is up to the platform plugin. Change-Id: I710e6fbee3005360ecf02bc6ef976e1beb513819 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Dynamic GL: Query gl handle and type via the native interfaceLaszlo Agocs2014-03-061-0/+6
| | | | | | Change-Id: I7ca5beaeb57ee2e4e9c175f53ac32371d1f6b5ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Enabling QQuickWidget and QOpenGLWidgetPaul Olav Tvete2014-02-121-1/+2
| | | | | | | | | Enable child widgets (without a native window) that render to an FBO and are composed with the raster backingstore by the platform plugin. A preliminary version of QOpenGLWidget is included as private API. Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Allow the platform to specify a press and hold delay.Michael Brasser2013-12-101-1/+2
| | | | | | | | | | | | | Press and hold is an interaction available on many platforms, particularly when touch is involved. In Qt Quick this is exposed to the user via MouseArea::onPressAndHold. This value should not be hard-coded, but rather use a platform-specified default. This commit adds the low-level hooks necessary for that to happen. Task-number: QTBUG-24793 Change-Id: I621a8ac9de66b881e34336228056bffbb6306a70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Allow platform to decide default behavior for show() based on window flagsTor Arne Vestbø2013-11-201-0/+1
| | | | | | | | | | | | | | | | The ShowIsMaximized and ShowIsFullscreen style hints were not granular enough to build a default behavior from that would be correct for all platforms. The recent Android patch that excluded dialogs from being shown maximized (Ia249e93dbbea1) has now been moved into a platform override in the Android integration plugin, leaving other platforms to the default behavior of using the style-hints. We still special case popup-windows though, as that behavior has been there for a while. Task-number: QTBUG-34969 Change-Id: Id36346d71bfc46171383ffe334592ca0b94e456f Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: Differ between ShowMaximized and ShowFullScreenEskil Abrahamsen Blomfeldt2013-11-011-1/+2
| | | | | | | | | | | | The default is now ShowMaximized which behaves as it did before, i.e. each window will fill the screen but the status bar will be visible. Calling showFullScreen() explicitly will now hide the status bar to maximize the amount of screen real estate occupied by the application. Task-number: QTBUG-33135 Change-Id: If0d0a2ab72f8026e76818290e2b953dbc0dec156 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Add QGuiApplication::sync() functionJørgen Lind2013-10-301-1/+4
| | | | | | | | | This will allow applications to make sure Qt has the same state as the window system at any given point. The use of this function is discouraged but it is very useful for auto tests. Change-Id: I691bff365fc391e9d7213f2607008983505bb774 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* QPA: Fix event dispatcher dependent operations in platform integrationLaszlo Agocs2013-10-071-0/+1
| | | | | | | | | | | | | | | | | | 999e5162ec3e86c9cb84c3ec95dfd0ba4b21277f breaks QPlatformIntegration implementations that perform tasks in their constructor that rely on the event dispatcher. For example creating a QSocketNotifier is not possible anymore since the event dispatcher is created later on. This is fixed by introducing an additional virtual in QPlatformIntegration that gets called after createEventDispatcher(). Two broken platform plugins have been identified so far: eglfs is creating socket notifiers to read events from input devices and xcb's input context plugins may use dbus. Both are updated accordingly. Task-number: QTBUG-33768 Change-Id: I5badb623958a52ab5314ff93dd7d60061f5df70a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* QPA: Fix semantics of GUI event dispatcher ownership in platform pluginsTor Arne Vestbø2013-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The QPlatformIntegration::guiThreadEventDispatcher() function acted as an accessor to event dispatchers created in the constructor of each platform plugin, but the logic and semantics of event-dispatcher handling in Qt itself (QCoreApplication/QGuiApplication) still assumed both ownership and control over the event dispatcher, such as when to create one, which one to create, and when to delete it. This conflicted with the explicit calls in the platform plugins to QGuiApplication::setEventDispatcher(), as well as left a possibility that the event-dispatcher created by the platform plugin would never be deleted, as none of the platform plugins actually took full ownership of the dispatcher and deleted it in its destructor. The integration function has now been renamed back to its old name, createEventDispatcher(), and acts as a factory function, leaving the logic and lifetime of event dispatcher to QtCoreApplication. The only platform left with creating the event-dispatcher in the constructor is QNX, where other parts of the platform relies on having an event-dispatcher before their initialization. We then need to manually take care of the ownership transfer, so that the event-dispatcher is still destroyed at some point. Change-Id: I113db97d2545ebda39ebdefa865e488d2ce9368b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a WindowManagement capability to QPlatformIntegrationLaszlo Agocs2013-09-201-1/+2
| | | | | | | | | | | | | To be set to false by eglfs and similar platforms where no real window management is provided. When this capability is not set, some of the changes done for QTBUG-26903 will be disabled, allowing dialogs to show up at their QDialog-chosen place on platforms where no WM is present and so windows are never repositioned by the system. Change-Id: If1dac3cd11f2a856913a51277431fe3ec644b719 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Add QPA session managerSamuel Gaist2013-09-041-0/+4
| | | | | | | | | | | | | | | | | | The QSessionManager doesn't allow customization in platform independent way. The new QPlatformSessionManager aims to change that. Now the QSessionManagerPrivate has a new QPlatformSessionManager member to forward all the calls to QSessionManager's functions. If no platform manager is present, the current behavior is used. QPlatformSessionManager mimics the current QSessionManager behavior. A new factory function has been added to QPlatformIntegration to return a QPlatformSessionManager Task-number: QTBUG-28228 Change-Id: Ida7ac16a8f5303df5014fcb67878170ebdb37203 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* Android: Fix crash when setting WA_NativeWindowEskil Abrahamsen Blomfeldt2013-07-311-1/+2
| | | | | | | | | | | | We don't support native widgets in Android, so we can get into a mess when people set this widget attribute, since the FB compositor will assume that all widgets have their own backing store. This adds a capability flag to the QPlatformIntegration which allows the plugin to disable the WA_NativeWindow feature. Task-number: QTBUG-32685 Change-Id: Ic200487da4a297f71ab594cf7c90d1e1d53bacd3 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QPlatformIntegration: add new style hint: SetFocusOnTouchReleaseRichard Moe Gustavsen2013-06-251-1/+2
| | | | | | | | | | | | | | | | On desktop platforms, widgets have traditionally received focus on mouse press. On touch platforms (iOS, Android) this is different, there you need to delay setting the focus until a touch release (probably to check if the press starts a flick or tap'n'hold etc). This patch will add a new style hint SetFocusOnRelease that can be set by the plugin to control this behavior in Qt. Change-Id: I2e4d714894e327822c855eb48a3b28e354726e95 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Make password mask characters themeable.Mitch Curtis2013-04-191-1/+2
| | | | | | | | Task-number: QTBUG-29871 Change-Id: I3cf739a321d7917f8f8431992e29bba0871b1934 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Android: Don't crash when displaying multiple top-levelsEskil Abrahamsen Blomfeldt2013-04-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | While the raster platform plugin supports multiple top level windows, this is not supported on the GL plugin, so if you use GL or QtQuick2 in your app and use several top levels, the app would crash with an error message. A problem is that the top-level SurfaceView is a special overlay View and does not support being stacked in a layout. So instead, we let all windows share the same GL surface and draw on top of each other. This works fine for simple use cases. We implement a new platform capability to make sure no top level windows (even combobox popups and dialogs) get non-fullscreen geometries. That has never worked properly with the eglfs plugin. Task-number: QTBUG-30473 Change-Id: Ia1438019638fc739cc93ffe79b46b81631254df2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Implement XEmbed protocolAlberto Mardegan2013-03-061-1/+2
| | | | | | | | | | | | | | | | | | | Add a static QWindow::fromWinId(WId id) constructor which can be used to create a QWindow object representing windows created by other processes. Then, QWindow::setParent() can be used to embed a window into a foreign window socket and QWindow::setTransientParent() to stick the current window on top of a foreign window. The changes in the QtWidgets module ensure that the focus chain (TAB navigation) correctly works when a QtWidgets-based window is embedded into another application. As far as the platform implementation is concerned, this commit only implements the embedding functionality in the XCB plugin. So, this is roughly equivalent to the Qt4 QX11EmbedWidget functionality. Change-Id: Iff8f7b9ee974d33fb30f36056f7838b433a413c7 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QPA: Add interface for setting the application state explicitlyRichard Moe Gustavsen2013-02-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation for this patch is twofold: 1: we need a way (for iOS/Android) to tell the current window to remove focus from the focus object when the user hides the input panel. Otherwise, if the focus object is e.g a line edit, the cursor will continue to blink inside it, which is wrong. As it stands, telling the active window to deactivate (by calling QWindowSystemInterface::handleWindowActivated(0)), will cause the whole application to deactivate if no windows are active, which is not what we want. 2: Qt currently understands just two application states, Activated and Deactivated. On mobile platforms we can have other states as well, like "suspended" on iOS. So controlling the application state should not depend on window activation, but instead be controlled through a separate API by the platform plugin. This patch will add the following function: QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState newState) that lets us control the application state from the plugin. This also means that we factor out application state handling from window activation, which also gives us a way to remove focus from a window while keeping the application active. To not break existing desktop platforms that relies on application activation being tied to window activation, we need to make this API opt-in by using a platform integration capability hint. This is not optimal, but found necessary after investigating several other solutions. Which states (other that active/inactive) it makes sense to add to Qt::ApplicationState will be a topic for later patches. Change-Id: Ic6fdd3b66867abb67da43eba04ec86f06d82ff94 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Added QOffscreenSurface class.Yoann Lopes2013-02-181-0/+4
| | | | | | | | | | | | Inherits QSurface and allows to use OpenGL from an arbitrary thread. Platform plugins can implement QPlatformOffscreenSurface, otherwise an invisible QWindow is used by QOffscreenSurface. This patch includes an implementation of QOffscreenSurface for XCB and EglFS platform plugins using pbuffers. Change-Id: I57b4fc1db417331f34826dcfa754b7698782fde4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Added MultipleWindows platform capability.Samuel Rødal2012-11-021-5/+6
| | | | | | | | | | | | | | Several platform plugins, like eglfs, kms, etc don't support multiple windows as there's no system compositor, they're rendering directly to a single back buffer. By adding a platform capability we'll be able to provide better error reporting when an application tries to create multiple QWindows on a single-window platform. Also, QML apps can use this capability to figure out whether they should create a QWindow for dialogs / popups / menus, or whether to just create items in the same scene, that are shown on top of the rest of the content. Change-Id: I15b8d21ee2bc4568e9d705dbf32f872c2c25742b Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Be able to obtain list of possible key combinations in platform integrationOliver Wolff2012-10-131-0/+2
| | | | | | | | | | | | As there is no way to obtain the list of possible keys for a shortcut in a platform independent way there needs to be a way to get that from the platform integration. Task-number: QTBUG-26902 Change-Id: I520add56ee09d5c3c58709fb29dad2fbfe4c9d0b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Add hint for touch -> mouse event synthesizingMorten Johan Sorvig2012-08-221-1/+2
| | | | | | | | | | | | | | | | | Commit 7808ec79 changes QApplication to synthesize mouse events from (unhandled) touch events. On Mac OS X this creates a conflict for two-finger scroll swipes, which generates both touch events and mouse wheel events: scrolling in QTextEdit will also select the text. Add a SynthesizeMouseFromTouchEvents platform style hint that enables the event synthesising. Set to true by default and false in Cocoa. Change-Id: I1ffa5a141476aa38b81ce92a87eff676c7ec2276 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add stylehint to use querying RTL keyboard support.Friedemann Kleint2012-07-111-1/+2
| | | | | Change-Id: Ic58ed7cb64cc7fe60b4d431e9f29e389c62265fc Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* QPlatformWindow: Add Window masks.Friedemann Kleint2012-06-261-2/+2
| | | | | | | | | Add functionality for window masks to QPlatformWindow, which is required to implement QWidget::setMask() in order to fix the regression in functionality from Qt 4.8. Change-Id: I2c2d5629f0b4c6d90e52595ad70b13559aab1f41 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add StartDragVelocity to style hintsLaszlo Agocs2012-06-051-1/+2
| | | | | | | | This will be used by Flickable in combination with the drag distance to improve the drag start detection logic. Change-Id: Ica30042ef3d15041d857b07fa4173dde3d3f900f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qpa api: replace QPA headers with something more benignGirish Ramakrishnan2012-05-221-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current 'we mean it' headers are considered too aggressive for QPA. Replaced using the following script. for file in `find -type f -name "qplatform*.h" -and -not -name "*_p.h"`; do LINE_NO_1=`grep -n -m 1 "W A R N I N G" $file | awk -F ':' '{print $1}'` LINE_NO_2=`grep -n -m 1 "We mean it." $file | awk -F ':' '{print $1}'` if [ -z "$LINE_NO_1" ]; then LINE_NO_1=`grep -n -m 1 "#define " $file | awk -F ':' '{print $1}'` LINE_NO_2=$((1+$LINE_NO_1)) else LINE_NO_1=$(($LINE_NO_1-2)) LINE_NO_2=$(($LINE_NO_2+2)) fi head -n $LINE_NO_1 $file > $file.new cat >> $file.new <<EOF // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // EOF tail -n +$LINE_NO_2 $file >> $file.new mv $file.new $file done Change-Id: I8a974c9bf8942647b7ad950afb372c1f738aa725 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-0/+155
The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>