summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformintegration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-11/+11
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-081-0/+3
|\ | | | | | | Change-Id: I4c0fd501db974fb8339944b8df845336776d80a9
| * eglfs: Fix raster windowsLaszlo Agocs2019-08-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also sanitize the initial WebAssembly hack. Both eglfs and wasm lack the concept of true raster windows. A QWindow with RasterSurface is rendered with OpenGL no matter what. The two platforms took two different approaches to work around the rest of the machinery: - wasm disabled the QOpenGLContext warning for non-OpenGL QWindows, - eglfs forced the QWindow surfaceType to OpenGLSurface whenever it was originally set to RasterSurface. Now, the latter breaks since c4e9eabc309a275efc222f4127f31ba4677259b7, leaving all raster window applications failing on eglfs, because flush in the backingstore is now checking the surface type and disallows OpenGLSurface windows. (just like how QOpenGLContext disallows RasterSurface windows) To solve all this correctly, introduce a new platform capability, OpenGLOnRasterSurface, and remove the special handling in the platform plugins. Change-Id: I7785dfb1c955577bbdccdc14ebaaac5babdec57c Fixes: QTBUG-77100 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Remove deprecated screen maintenance functions in QPlatformIntegrationTor Arne Vestbø2019-03-221-38/+0
| | | | | | | | | | | | | | | | | | The logic for removing QScreens from QGuiApplicationPrivate has been moved into the QScreen destructor, similar to QWindow. Change-Id: I18ad57d8dcf9f765c47be7c082bf075af3ebe69c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-201-52/+9
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformintegration.cpp src/gui/kernel/qplatformintegration.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/xcb/qxcbconnection_screens.cpp Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
| * Move screen maintenance functions from QPlatformIntegration to QWSITor Arne Vestbø2019-03-191-49/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindowSystemInterface is the de facto API for any plumbing going from the platform plugin to QtGui. Having the functions as protected members of QPlatformIntegration was idiosyncratic, and resulted in awkward workarounds to be able to call the functions from outside of the QPlatformIntegration subclass. The functions in QPlatformIntegration have been left in, but deprecated so that platform plugins outside of qtbase have a chance to move over to the new QWSI API before they are removed. Change-Id: I327fec460db6b0faaf0ae2a151c20aa30dbe7182 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | QtGui/Network/OpenGl/Widgets/Xml: use \nullptr in documentationChristian Ehrlicher2019-02-201-2/+2
| | | | | | | | | | | | | | Replace null and '\c nullptr' with \nullptr in the documentation. Change-Id: I58934eea06943309ba895833f1991629870ab45b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-211-1/+1
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
| * Documentation: Add \nullptr macro and use where applicableFriedemann Kleint2019-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt for Python users reading the documentation assume that int(0) can be passed for pointer parameters. Use the newly introduced \nullptr to disambiguate this. In a follow-up step, the \nullptr macro can be defined as None when generating the Qt for Python documentation. Task-number: PYSIDE-903 Change-Id: I3a45f87175a0668ab5f3f95f0aff409f7e3ef027 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Refresh QGuiApplication's devicePixelRatio cache when screens changeSteve Mokris2018-12-101-0/+5
| | | | | | | | | | | | Task-number: QTBUG-63548 Change-Id: Id934cda6e15449c00c80a646055899f49580da88 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Rename QList<T>::swap(int, int) to swapItemsAt()Lars Knoll2018-12-031-1/+1
|/ | | | | | | | | | | The old name was confusing as it conflicted with QList<T>::swap(QList &other), that was doing something completely different. Rename the method to swapItemsAt() which is a lot clearer. Change-Id: Iac77a1e790a7256766f83a24d2a243c880d875f4 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* dnd: send DragEnter and DragMove on DnD startGatis Paeglis2018-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This was a regression from Qt4 and also is the documented behavior. In addition this patch fixes various issues with cursor shape updating that were discovered along the way and that are necessary for testing the new changes. The code in QGuiApplicationPrivate::processDrag() also needed a fixup, particularly the resetting of QGuiApplicationPrivate::currentDragWindow. Without this fix we would get DragMove (the one that immediately follows the DragEnter) only for the first DragEnter event. For example when dnd starts on mouse press then for mouse click we would get: <click> DragEnter->DragMove->DragLeave <click> DragEnter->DragLeave but the expected is: <click> DragEnter->DragMove->DragLeave <click> DragEnter->DragMove->DragLeave Task-number: QTBUG-34331 Change-Id: I3cc96c87d1fd5d1342c7f6c9438802ab30076e9e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-291-2/+5
| | | | | | | | | We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Check for WindowActivation capability instead of platformJohan Klokkhammer Helsing2018-03-061-1/+1
| | | | | | | | | | | Before running tests that depend on QWindow::requestActivate Gets rid of several Wayland platform checks in tst_QWindow. Change-Id: I7a5e029044a968dfcf87ecbb5105c01d52852d35 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* doc: improve QPlatformIntegration::possibleKeys() documentationGatis Paeglis2018-02-221-4/+5
| | | | | | | | | | | | | - There is no need to mention qkeymapper, which is an internal implementation detail. - Describe the encoding of int. - Add a note that calling possibleKeys() outside key event handler context is not valid. Change-Id: Ife9b7d1496f04b5a433ed2d56f29c4f01f174441 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QLineEdit: implement quick text selection by mouseElvis Angelaccio2018-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is a standard feature in GtkEntry widgets or HTML <input type="text"> elements. During a normal text selection by mouse (LeftButton press + mouse move event), it's now possible to quickly select all the text from the start of the selection to the end of the line edit by moving the mouse cursor down. By moving it up instead, all the text up to the start of the line edit gets selected. If the layout direction is right-to-left, the semantic of the mouse movement is inverted. This feature is only enabled if the y() of the mouse move event is bigger than a fixed threshold, to avoid unexpected selections in the normal case. This threshold is set by the QPlatformTheme and a value smaller than zero disables this feature. The threshold is updated whenever the style or the screen changes. [ChangeLog][QtWidgets][QLineEdit] Implemented quick text selection by mouse in QLineEdit. Change-Id: I4de33c2d11c033ec295de2b2ea81adf786324f4b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* doc: Fix remaining qdoc warmings for Vulkan stuffMartin Smith2018-01-181-1/+1
| | | | | | | | | | | Several uses of #if QT_CONFIG(vulkan) were modified to for classes QVulkanFunctions and QVulkanDeviceFunctions was added to qplatformvulkaninstance.h, because the include file that contains them doesn't exist when vulkan isn't there. Change-Id: I392202ab5fe9bb4c558a991870e6ebf79254aec0 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Basic Vulkan enablersLaszlo Agocs2017-03-171-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | For Android, Windows and xcb. Verified on Win10 with NVIDIA, Win10 with AMD, Android with Tegra K1, Android aarch64 with Tegra X1, and Linux aarch64 with Tegra X1 (Jetson TX1, L4T). Introduce QPA-based Vulkan library loader, core function resolver, and instance creation support. In addition to creating a new VkInstance, adopting an existing one from an external engine is supported as well. The WSI specifics are hidden in the platform plugins. Vulkan-capable windows use the new surface type VulkanSurface and are associated with a QVulkanInstance. On Windows VULKAN_SDK is picked up automatically so finding vulkan.h needs no additional manual steps once the LunarG SDK is installed. [ChangeLog][QtGui] Added support for rendering to QWindow via the Vulkan graphics API. Task-number: QTBUG-55981 Change-Id: I50fa92d313fa440e0cc73939c6d7510ca317fbc9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add new API to control whether shortcuts are shown in context menusJake Petroules2017-03-141-0/+2
| | | | | | | | | | | | | Shortcuts are universally not shown on macOS or mobile platforms, making applications look very obviously out of place. Windows and GNOME desktop environments almost never use them. Only KDE appears to do so commonly; default accordingly. Task-number: QTBUG-49435 Change-Id: Ieac4cee57b15a02be5258f3d07749af6316af62b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Enable QWindowContainer on AndroidLaszlo Agocs2017-02-271-1/+6
| | | | | | | | | | [ChangeLog][Platform Specific Changes][Android] QWidget::createWindowContainer() is now supported on Android for embedding OpenGL-based QWindows into widget UIs. Task-number: QTBUG-59175 Change-Id: I84d3703bcd44c63b1fdfe6772b7f3de9d5c18ddf Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Make wheelScrollLines a QStyleHintAllan Sandfeld Jensen2017-01-251-0/+2
| | | | | | | | | The number of lines to scroll on a wheel click have previously been a QPlatformTheme hint and QApplication setting, this patch moves it to QStyleHint so it may be easier read by QGuiApplications. Change-Id: I80673c7b99d78c6407b1202b3742e1cb5fef0583 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Always instantiate QPlatformAccessibilityFrederik Gladhorn2017-01-041-2/+7
| | | | | | | | | | | | | Instead of returning 0, instantiate QPlatformAccessibility which delegates the handling of accessibilty to accessibilitybridge plugins. This makes it possible to implement entirely custom handling of the accessibility events, making it possible to write for example in-process screen readers. Change-Id: I7bcfd83b769af8ca2689fb38add1345719cf804f Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Add QStyleHints::useHoverEffectsJ-P Nurmi2016-07-201-0/+2
| | | | | | | | | | | | | The delivery of hover events creates unnecessary overhead on touch platforms. This allows Qt Quick Controls 2 to determine whether the underlying platform wants hover effects. The hover effects are enabled by default for the classic desktop platforms: Linux, Windows & macOS. Change-Id: Ia4e7b5c0fcb7af8f1c47e06fb28086cffdf35976 Task-number: QTBUG-50003 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Gui: use const (and const APIs) moreAnton Kudryavtsev2016-06-011-2/+2
| | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I88d08d499e1be72c1f6d983fecdcee513df18aa2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Ensure we can query all GL functions in all platform pluginsLars Knoll2016-03-011-2/+4
| | | | | | | | | This is required to simplify our code in the opengl classes and makes it possible to remove OS dependent code paths in Qt Gui. Change-Id: Ice09440840c86b2d6ac8d3955d273846695338d4 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* 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/+11
| | | | | | | | | | | | | 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>
* Update QPlatformIntegration::createPlatformWindow() documentationTor Arne Vestbø2015-10-281-6/+4
| | | | | | | The function is not limited to creating top level windows. Change-Id: Iedeeba0093f251c852e9b7c9ba23c567a79a53f8 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Clarify foreign window documentation a bitTor Arne Vestbø2015-10-161-2/+1
| | | | | | | Change-Id: I50193cb0c106bc17a008e6778d2d722545c7cb1c Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Notify when the primary screen changesAleix Pol2015-09-081-1/+38
| | | | | | | | | | | | | 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>
* Introduce cross platform high-dpi scalingMorten Johan Sørvig2015-07-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a coordinate scaling layer to QtGui, which supports 'devicePixelRatio' type high-dpi on all platforms, in production and also for development and testing purposes. High-DPI scaling is opt-in, by setting environment variables: QT_SCALE_FACTOR - sets a global scale factor QT_AUTO_SCREEN_SCALE_FACTOR - sets per-screen scale factors, where the scale factors are provided by the platform plugin. This QtGui scaling can be used instead of or in addition to scaling done by the window system. This distinction is not visible to applications [when they use Qt API], which will see a change in the value returned by the devicePixelRatio() accessors as usual. Introduce a new (private to Qt) coordinate system: native pixels. The coordinate system stack now looks like: device-independent pixels (app, upper parts of Qt) native pixels (lower parts of Qt Gui, platform plugins) device pixels (backing stores and OpenGL) Add private QHighDpi namespace with scaling functions that convert between device-independent pixels and native pixels: T toNativePixels(T, QWindow *); T fromNativePixels(T, QWindow *); Add scaling calls the QWindow (and friends) cross-platform implementation, around the calls to QPlatformWindow functions. QPlatformWindow now uses native coordinates - platform code remains largely unchanged since native coordinates are window system coordinates. QWindow now uses (possibly) scaled coordinates. This means that platform plugins no longer can rely on QWindow::geometry() and related functions. QPlatformWindow::windowGeometry() and other convenience functions have been added for use when the platform plugin needs to convert scaled geometry to native geometry. Add Qt::AA_NoHighDpiScaling, which can be use to disable any scaling in QtGui, effectively ignoring the environment variables. (Note that this does not disable any scaling done by the window system.) Contributions from Friedemann and Paul. Task-number: QTBUG-46615 Change-Id: I673bbd69c130e73b13cce83be11bfb28f580bf60 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Expose ItemViewActivateItemOnSingleClick in QStyleHintsEike Hein2015-04-101-0/+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-0/+14
| | | | | | | | | | | | | 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-0/+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-2/+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-2/+6
| | | | | | | | | | 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-0/+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-5/+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>
* Track QPlatformScreen -> QScreen using QPointerTor Arne Vestbø2015-01-241-1/+0
| | | | | | | | | | Allows the QPlatformScreen to verify that the QScreen is alive before sending events to QPA for the given screen (which will assert if the screen is being destroyed). Change-Id: Ie77674fead3e0a4d4f6fedbf1f7f3c98364c7485 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Introducing QPlatformHardwareCompositor.Gunnar Sletta2015-01-171-0/+5
| | | | | | | | | | 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-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | 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/+10
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-061-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp src/opengl/qglpixelbuffer.cpp src/opengl/qglshaderprogram.cpp tests/auto/opengl/qglthreads/tst_qglthreads.cpp Change-Id: Iaba137884d3526a139000ca26fee02bb27b5cdb5
| * Rename new QOpenGLContext APIsLaszlo Agocs2014-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | isES() becomes isOpenGLES(). The library type enums are changed DesktopGL -> LibGL and GLES2 -> LibGLES. This removes the now unnecessary version number, the confusing "desktop" term and provides better readability. The old function/values are kept until the related qtdeclarative changes are integrated. Task-number: QTBUG-38564 Change-Id: Ibb0a1209985f1ce4bb9451f9b7b093c2b68a6505 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add public and QPA APIs for adapting existing OpenGL contextsLaszlo Agocs2014-04-241-1/+20
|/ | | | | | | | | | | | | For now only xcb on GLX is supported. Other platforms will follow later. Add also some missing documentation for the platform OpenGL context factory functions. [ChangeLog] QOpenGLContext is now able to adopt existing native contexts. Task-number: QTBUG-37552 Change-Id: I5dd959f102df178f646b2df5989203b5dc6de376 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Make QOpenGLFunctions able to resolve everythingLaszlo Agocs2014-03-061-0/+10
| | | | | | | | | | | | | 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/+24
| | | | | | Change-Id: I7ca5beaeb57ee2e4e9c175f53ac32371d1f6b5ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Allow the platform to specify a press and hold delay.Michael Brasser2013-12-101-0/+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>