summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformintegration.h
Commit message (Collapse)AuthorAgeFilesLines
* Add QPlatformIntegration::BackingStoreStaticContents capabilityTor Arne Vestbø2024-02-131-1/+2
| | | | | | | | | | | | | | This was a feature in Qt 4, but the only platform that carried it over to Qt 5 was Windows, in ab76593f18396e693f24066592244ca95e135ea2, and that's still the situation. As a first step in possibly implementing this on more platforms, lets replace the hard-coded check in QWidgetRepaintManager::hasStaticContents with a proper QPlatformIntegration capability check in the only call site. Pick-to: 6.7 Change-Id: I2067109f45116cd8c62facf7224cd748f19e845b Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Long live QPlatformKeyMapper!Tor Arne Vestbø2023-10-061-0/+5
| | | | | | | | | | | | | | The QKeyMapper class never got a platform integration companion. As we might be adding more functionality here in the future, let's fix that now, instead of adding more hooks directly to the platform integration class. The QKeyMapper will soon update its possibleKeys signature to return QKeyCombination, but for now transform the result. Change-Id: I88ef498180b2a8a7937a74627b7eb6b5156e872a Reviewed-by: Liang Qi <liang.qi@qt.io>
* Add a platform theme option to affect SH_UnderlineShortcutMikolaj Boc2023-02-071-1/+2
| | | | | | | | | | | | | The style hint SH_UnderlineShortcut can now be turned on/off via the platform theme. No change in functionality so far on any platform, this behaves the same way it did before the change. The change just adds a possibility for platforms to redefine the default underlining behavior. Task-number: QTBUG-76587 Change-Id: Ibda104f1b733371da19825b96e73c22f42faf853 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add QGuiApplication API to set a number-badge in the Dock/task barTor Arne Vestbø2022-12-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is supported on macOS, iOS, and Windows. On Android no official API exists for badging the application icon, and we don't want to take on dependencies like ShortcutBadger [1]. The macOS and iOS implementations are trivial. The same goes for the WinRT based implementation on Windows, but this API is only available for applications that have a so called "package identity", and does not seem to be stable for Windows 10. To cover the cases where this API is not available we fall back to drawing the badge manually, and set it as an overlay icon on the task bar using ITaskbarList3. The look of this badge has been tweaked to match the Windows 11/10 styles, and will pick up the user's choice of dark/light mode and accent color if available. [1] https://github.com/leolin310148/ShortcutBadger/ [ChangeLog][QtGui] Added QGuiApplication::setBadgeNumber() to inform the user about e.g. the number of unread e-mail or queued tasks. The badge will be overlaid on the application's icon in the Dock on macOS, the home screen icon on iOS, or the task bar on Windows. Task-number: QTBUG-94009 Change-Id: I6447d55177f9987b0dfcd93caf63c6167f7224c7 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add flicking behavior hints to platform integration and themeShawn Rutledge2022-10-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These will be used in QtQuick Flickable. Flickable.flickDeceleration is a sort of friction, the rate at which a flick will decelerate when the user is flicking on a touchscreen or rolling a clicky mouse wheel, and then flicking stops. So far, the default has always been 1500 (defined in qtdeclarative), which (everyone seems to agree) prevents Flickable from slowing down reasonably fast when scrolling stops. So let's try 5000 logical pixels / sec² as a default, and each platform will be able to customize it. The docs already say "The default value is platform dependent"; now it can come from StyleHint::FlickDeceleration. FlickMaximumVelocity: the units are in logical pixels / sec. The default has always been 2500 in qtdeclarative, but there were some early complaints that Flickable was too slow on Android, for example (which were somewhat mitigated by DPI conversions). So now that also becomes adjustable on each platform (although really, it should be mainly the DPI that matters, because the user's perception is in actual distance moved per second). FlickStartDistance is how many logical pixels the Flickable must be dragged by a finger before it begins the animation to keep moving when the finger is lifted. (Analogous to StartDragDistance for mouse-drags) [ChangeLog][QPA] Added platform FlickStartDistance, FlickMaximumVelocity and FlickDeceleration hints for the benefit of QtQuick Flickable Task-number: QTBUG-35608 Task-number: QTBUG-35609 Task-number: QTBUG-52643 Task-number: QTBUG-97055 Change-Id: If50c1de895c127f4b0ab0634c865f469a38e08ba Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* xcb: Get some style hints from xsettingsJiDe Zhang2022-06-181-1/+2
| | | | | | | | | | According to https://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/. Added support for Net/CursorBlinkTime Net/DoubleClickTime Net/DoubleClickDistance Net/DndDragThreshold. Change-Id: Ief208736ed2938792d935bfd730fefdd745394b6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace QT_NO_ACCESSIBILITY with QT_CONFIG(accessibility)Allan Sandfeld Jensen2022-06-151-1/+1
| | | | | | | Pick-to: 6.4 Change-Id: Iee4bd8970810be1b23bdba65a74de912401dca65 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* GUI: add ScreenWindowGrabbing capabilityLiang Qi2022-03-171-1/+2
| | | | | | | | | On Wayland, there is no protocol to do it yet. Task-number: QTBUG-100792 Task-number: QTBUG-101145 Change-Id: Id72625a8161359111a2d0f43f3215e787778ba6b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add a platform capability indicating support for QRhi-based renderingLaszlo Agocs2021-01-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This attempts to reconcile a minor difference between Qt 5 and Qt 6: Running Qt Quick applications with a platform plugin such as vnc, led to an automatic fallback to the 'software' backend based on the OpenGL capability reported from the platform plugin. In Qt 6.0 this logic is gone from Qt Quick, because we do not have, and wish not to have, individual flags for each and every 3D API on this level. Therefore in Qt 6.0 a Qt Quick application running with the vnc (or linuxfb, or minimal) platform needs an explicit selection of the software backend via QT_QUICK_BACKEND or QQuickWindow::setGraphicsApi(). To keep migration for users of such platform plugins easier, we can still reintroduce a Qt 5-like logic: by having a high level Is-QRhi-Supported type of flag, we can make Qt Quick query that, and trigger the fallback to the software backend when it is reported as false by the platform plugin. As this is the minority case and a conscious choice by platform plugins, the flag can be opt-out (i.e. true by the default hasCapability implementation). When it comes to the existing OpenGL flag, that needs to stay for compatibility reasons, but it is worth noting that the new flag semantically falls in the exact same category: it does not indicate things will really work at run time, but rather serves as an opt-out, "do not even try" type of declaration the platform plugin can make, which then allows modules like Qt Quick to make early, upfront decisions about which rendering paths/backends to take. Change-Id: I8d6fddeb82ca6eece7b7abc1a5b64ebe6d8af29d Task-number: QTBUG-89561 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-071-3/+3
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Plumb application quit through platform pluginTor Arne Vestbø2020-09-141-0/+1
| | | | | | | | | | | | | | | | | | If we have a platform plugin we ask the platform to quit, and if not we fall back to the base implementation of QCoreApplication that sends Quit events directly. This allows the platform to involve the rest of the system in the process. The platform will then come back with a spontaneous quit via QWSI::handleApplicationTermination(), which will then send the corresponding Quit even from QGuiApplication like normal. Task-number: QTBUG-45262 Task-number: QTBUG-33235 Task-number: QTBUG-72013 Task-number: QTBUG-59782 Change-Id: I0000aaf7192e4b905933c5da0e53901c6c88f26a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Introduce QWindow::paintEvent with QPA plumbingTor Arne Vestbø2020-08-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The explicit paint event on QtGui and QPA level allows us to untangle the expose event, which today has at least 3 different meanings. It also allows us to follow the platform more closely in its semantics of when painting can happen. On some platforms a paint can come in before a window is exposed, e.g. to prepare the first frame. On others a paint can come in after a window has been de-exposed, to save a snapshot of the window for use in an application switcher or similar. The expose keeps its semantics of being a barrier signaling that the application can now render at will, for example in a threaded render loop. There are two compatibility code paths in this patch: 1. For platform plugins that do not yet report the PaintEvents capability, QtGui will synthesize paint events on the platform's behalf, based on the existing expose events coming from the platform. 2. For applications that do not yet implement paintEvent, QtGui will send expose events instead, ensuring the same behavior as before. For now none of the platform plugins deliver paint events natively, so the first compatibility code path is always active. Task-numnber: QTBUG-82676 Change-Id: I0fbe0d4cf451d6a1f07f5eab8d376a6c8a53ce8c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Introduce platform API abstraction for QOpenGLContextTor Arne Vestbø2020-07-021-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is available by including qopenglcontext.h as usual, but scoped in the QPlatformInterface namespace. The namespace exposes platform specific type-safe interfaces that provide: a) Factory functions for adopting native contexts, e.g. QCocoaGLContext::fromNative(nsContext, shareContext); b) Access to underlying native handles, e.g. openGLContext->platformInterface<QCocoaGLContext>->nativeContext() c) Platform specific functionality, e.g. static QWGLContext::openGLModuleHandle() openGLContext->platformInterface<QEGLContext>->doSomething(); The platform interfaces live close to the classes they extend, removing the need for complex indirection and plumbing, and avoids kitchen-sink modules and APIs such as the extras modules, QPlatformFunctions, or QPlatformNativeInterface. In the case of QOpenGLContext these platform APIs are backed by the platform plugin, so dynamic_cast is used to ensure the platform plugin supports the requested interface, but this is and implementation detail. The interface APIs are agnostic to where the implementation lives, while still being available to the user as part of the APIs they extend/augment. The documentation will be restored when the dust settles. Task-number: QTBUG-80233 Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Support MaximizeUsingFullscreenGeometryHint in resizeMaximizedWindows()Eskil Abrahamsen Blomfeldt2019-11-071-1/+2
| | | | | | | | | | | | | | In QPlatformScreen there is a convenience function which resizes windows when the screen changes. This did not have support for MaximizeUsingFullscreenGeometryHint and would mistakenly resize these windows to the available geometry. Since not all QPA plugins support this hint, we have to add a capability flag to avoid changing behavior on platforms where it works as intended. Task-number: QTBUG-74202 Change-Id: Ife88f597fbb3affa722f63ac18fb5719ffa8ed33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-08-131-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/corelib/tools/qlist.h src/gui/painting/qcompositionfunctions.cpp src/gui/painting/qtriangulator_p.h src/gui/text/qfontengine_p.h src/network/kernel/qhostinfo_p.h src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-081-1/+2
| |\ | | | | | | | | | Change-Id: I4c0fd501db974fb8339944b8df845336776d80a9
| | * eglfs: Fix raster windowsLaszlo Agocs2019-08-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Revert "Revert "Remove deprecated screen maintenance functions in ↵Liang Qi2019-04-011-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformIntegration"" This reverts commit 300940a6c9eb0f74cefda7d76a5d19f56ec50253. The fixes for leaf modules landed already. Task-number: QTBUG-74816 Change-Id: I1c7f0705c20d030419ceedca485106af73946b3c Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | | Revert "Remove deprecated screen maintenance functions in QPlatformIntegration"Liang Qi2019-03-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7a64ffb7738dc975b5008800901c8cd8ab238a0f. This change landed in 5.13 too early, so there is no baseline with both APIs in dev. This will be reverted later when the fixes for leaf modules landed. Task-number: QTBUG-74816 Change-Id: Ie5ee41fbf6be53b8fcb4289ac1ec3974e5bf6e42 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-03-261-6/+0
|\| | | | | | | | | | | Change-Id: I38389a69411f4549fed432f1181dbe23398b34a2
| * | Remove deprecated screen maintenance functions in QPlatformIntegrationTor Arne Vestbø2019-03-221-10/+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-4/+8
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | More nullptr usage in headersKevin Funk2019-03-141-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* / QtGui: Use Q_DISABLE_COPY_MOVE for QPA interface classesFriedemann Kleint2018-12-131-0/+4
|/ | | | | | | | Introduce Q_DISABLE_COPY_MOVE or replace existing Q_DISABLE_COPY and add default constructors where needed. Change-Id: Ibd14ee9d1d69e64f6289efe789d4b64a3d6cb998 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-291-1/+1
| | | | | | | | | 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-0/+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>
* QLineEdit: implement quick text selection by mouseElvis Angelaccio2018-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-281-0/+1
|\ | | | | | | Change-Id: I7d84cfed0b2a122d334b8a920e6e4f18472d2f11
| * QWindow: Remove "_q_foreignWinId" dynamic propertyTor Arne Vestbø2017-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The platform plugins reading this out of the QWindow was a layering violation, and propagates the notion that a window can shape shift into representing a new native handle, while none of the platform plugins support this. A foreign QWindow is created via the factory function fromWinId(), at which point we can pass the WId all the way to the platform plugin as function arguments, where the platform will create a corresponding platform-window. The platform window can then answer the question of whether or not it's representing a foreign window, which determines a few behavioral changes here and there, as well as supplying the native window handle back for QWindow::winId(); [ChangeLog][QtGui][QWindow] The "_q_foreignWinId" dynamic property is no longer set nor read. [ChangeLog][QtGui][QPA] The function createForeignWindow() has been added to QPlatormIntegration and is now responsible for creating foreign windows. The function isForeignWindow() in QPlatformWindow has been added, and platforms should implement this to return true for windows created by createForeignWindow(). Task-number: QTBUG-58383 Change-Id: If84142f95172f62b9377eb5d2a4d792cad36010b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Enable QWindowContainer on AndroidLaszlo Agocs2017-02-271-1/+2
|/ | | | | | | | | | [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-1/+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>
* Add QStyleHints::useHoverEffectsJ-P Nurmi2016-07-201-1/+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>
* Add qtguiglobal.h and qtguiglobal_p.hLars Knoll2016-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. A similar scheme and naming convention is already being used for many other modules (e.g. printsupport, qml, quick). That header will later on #include the configuration file for Qt Gui. For now it defines the Q_GUI_EXPORT macro for this library. In addition, add a private global header, qtguiglobal_p.h, that can later on include the private config header for Qt Gui for things we don't want to export to the world. Change-Id: Id9ce2a4f3d2962c3592c35e3d080574789195f24 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@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/+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>