summaryrefslogtreecommitdiffstats
path: root/src/gui/platform
Commit message (Collapse)AuthorAgeFilesLines
* qxkbcommon: UCS-4-encode surrogate characters in QKeyEvent::key()Gatis Paeglis2021-12-061-1/+5
| | | | | | | | | Fixes: QTBUG-72776 Pick-to: 6.2 5.15 Done-with: Liang Qi <liang.qi@qt.io> Change-Id: I9d1f4e34527079c3bc460016fe9b953636b4d6cb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Document which header to include for the various native interfacesTor Arne Vestbø2021-12-042-0/+4
| | | | | | | Fixes: QTBUG-98654 Pick-to: 6.2 Change-Id: Ic5ea3cc7d90ed336a5b6e827d1523bdd58fabc13 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* wasm: Move Blob creation code to qstdwebMorten Johan Sørvig2021-11-271-19/+5
| | | | | | | | | | | | | | Add Uint8Array::copyFrom() and Blob::copyFrom(), which constructs JS data containers with content copied from the C heap. These should not be confused with e.g. the Uint8Array(buffer, size) constructor, which creates a Uint8Array which references content on the heap, without making a copy. Change-Id: Id7d25d8044ee3914d74698e5a15c93226568eaf3 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: Move streamFile() to qstdwebMorten Johan Sørvig2021-11-261-39/+1
| | | | | | | | | This function is useful also outside of local file access, for example when reading clipboard (file) content. Change-Id: I132546deb6df2969467051c348c05d9331d2cfd2 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* gui: Fix typos in documentationJonas Kvinge2021-10-121-2/+2
| | | | | | Pick-to: 5.15 6.2 Change-Id: I533f5a55cd0cd60a76990b552d7dab51a301ac1c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* gui: Fix typos in source code commentsJonas Kvinge2021-10-124-4/+4
| | | | | | Pick-to: 5.15 6.2 Change-Id: Ie53e5542a8f93856470982939ecd8ec90b323d69 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add message debug entry for DPI change eventsMorten Johan Sørvig2021-10-071-0/+6
| | | | | | | | WM_GETDPISCALEDSIZE and WM_DPICHANGED. Pick-to: 6.2 Change-Id: I0614b0f552e52fc77d026dbc7e8c13b05f7d0e9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Always fallback opening URLs to the regular way if portal failsIlya Fedin2021-10-071-14/+6
| | | | | | | | | | | Even if the code fails, the runtime will have a xdg-open binary that supports the required API (portals in flatpak and userd launcher in snap) Task-number: QTBUG-83939 Change-Id: I8527cfe20411c535686b7171ff9ef285ab9e10aa Reviewed-by: Jan Grulich <jgrulich@redhat.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Expose the config and display for EGL-based QOpenGLContextsLaszlo Agocs2021-09-131-0/+12
| | | | | | | | | | | | | | | | ...in the native interface. Using OpenXR is impossible on some platforms (for example, Android) without knowing all three. The EGLContext alone is not enough, and EGL offers no way to query the EGLConfig a context was created with. https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_opengl_es_enable Therefore, expose all three so libs/apps can use the new way to query these native resource without resorting to the old-style nativeResourceFor* queries. Change-Id: I7efb0a26b858150da55e711752af99426e744322 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Improve QAppleKeyMapper loggingTor Arne Vestbø2021-09-131-1/+14
| | | | | | Pick-to: 6.2 Change-Id: If0018f2a1c8809e66b695949e8dc7b463c4612a6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Revert "Add Deepin to the list of GTK based desktop environments"Tang Haixiang2021-09-091-2/+1
| | | | | | | | | | | | | | | | | This reverts commit 39f0633f0b00444443e43599aab219a56f6cae2d. The Deepin desktop environment is developed based on Qt, but some applications use dialog boxes of GTK, and some applications use dialog boxes of Qt. This doesn't look good. The initial commit was trying to unify this by always using GTK dialogs. But this turned out to not look good, so instead the plan is that all application dialogs can be based on Qt. Reverting the original commit as a result, as it is no longer applicable. Pick-to: 6.2 Change-Id: I2824b7b2f292f3896c9f94ccce6979f77d66578b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add Deepin to the list of GTK based desktop environmentsTang Haixiang2021-09-091-1/+2
| | | | | | | | | Deepin prefers the GTK3 theme implementation with native dialogs etc. Pick-to: 6.2 6.2.0 Change-Id: I54cea9d17c0d7f5e466c700adce5aa68f0cf5564 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* macOS: Clarify QAppleKeyMapperTor Arne Vestbø2021-08-201-7/+29
| | | | | | Pick-to: 6.2 Change-Id: I6a6fb4a8ee6e9457b3a09b0ef51e71028df3356d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Change since for QNativeInterface::QX11Application to 6.2Jonas Kvinge2021-08-171-1/+1
| | | | | | | | | The documention currently incorrectly lists QNativeInterface::QX11Application as available since 6.0. Pick-to: 6.2 Change-Id: I13256a1504b2bd93296434438835791f12353089 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Map dead keys directly to their terminator when building key mapTor Arne Vestbø2021-08-162-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a key press comes in we may end up in QAppleKeyMapper::possibleKeys() as part of checking whether the key press should trigger a QShortcut. The function builds on QAppleKeyMapper::keyMapForKey(), which provides a map from the given virtual key to all the possible Qt::Keys that can be produced by applying different modifier key combinations. The map is built using the Carbon function UCKeyTranslate, that takes the current keyboard layout, virtual key, and modifiers, and produces the resulting characters. The function also maintains a running dead key state via one of the arguments. When mapping a dead key, the state variable will be updated to the current dead key state, which then affects the next call to the function (for the next key press). The problem is that we're not calling UCKeyTranslate for each key press. We are calling it in a loop, for a single key press, to build up a map of all the possible characters produced by varying the modifier keys. And in doing so, we are passing on the dead key state from one call to the next, even if these are for different modifiers. The result is that the first call, for the dead key, results in mapping to \0, as UCKeyTranslate produces no output, it only modifies the dead key state. And then the next call, for the next modifier key combination, results in mapping to a character that incorrectly incorporates the dead key state (resetting it in the process). What we really want is to directly map the initial modifier combination to the dead key terminator character, if one is defined. This is the character produced if the dead key state is cancelled, for example by pressing a key that's not defined in the dead key state. To achieve this we pass kUCKeyTranslateNoDeadKeysMask as the translate options to UCKeyTranslate, and always reset the dead key state before every call. Another common way to achieve the same result would be to call UCKeyTranslate a second time when detecting that the first call produced a dead key state, for example with a synthetic space key, to trigger the terminator output. But this can potentially fail if the space key actually has a defined output in the dead key state. Fixes: QTBUG-95471 Pick-to: 6.2 6.1 Change-Id: Icdae7639fd9a641a86c9d6615679bd93d380ff5c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Don't treat null-key as potential shortcut keyTor Arne Vestbø2021-08-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mapping virtual keys and modifiers to their corresponding characters via a keyboard layout we may hit combinations that do not produce any characters. This can happen if there's no <key> element defined for the virtual key, or if the output attribute of the element is empty (despite the spec saying there should always be one UTF-16 code point in the output). https://developer.apple.com/library/archive/technotes/tn2056/_index.html When that happens QAppleKeyMapper::keyMapForKey() will map the combination to a null-QChar, resulting in the "key" being 0. We do not want to propagate this back to the QShortcutMap machinery, as QShortcutMap does not validate the keys coming out of QKeyMapper::possibleKeys(). In particular, it doesn't check the isEmpty() or count() of the QKeySequences it creates. And even if it did, QKeySequence itself seems to treat Qt::Key(0) + Qt::SomeModifier as a non-empty sequence, so passing on 0-keys would still give weird bugs. The user-visible result of passing back 0-keys is that QShortcutMap will treat it as a partial match for any incoming key combination (as long as some modifier is pressed that triggers the QShortcutMap machinery), which resulting in eating the key press. This compounded the issue in QTBUG-95471. Regression after fab3dfff7d53d496a31c5d2df972ddacfe861a4d. Task-number: QTBUG-95471 Pick-to: 6.1 6.2 Change-Id: I2e51ec86f4df2a708e1757be827ab74859be3c8b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Add native interface for X11 application, exposing display and connectionTor Arne Vestbø2021-08-061-0/+30
| | | | | | | | | | | | | | | | | | | | | The major use-case of the now private QX11Info from Qt X11 Extras was getting hold of the Xlib display and XCB connection, for example in KDE: https://lxr.kde.org/search?%21v=kf5-qt5&_filestring=&_string=QX11Info A new native interface for QGuiApplication has now been added that exposes these two properties, e.g.: if (auto *x11App = app.nativeInterface<QX11Application>()) qDebug() << x11App->display() << x11App->connection(); To avoid type clashes one of the enum values of QXcbNativeInterface's ResourceType had to be renamed. Pick-to: 6.2 Task-number: QTBUG-93633 Change-Id: I2e366a2bb88bd3965ac6172ad000ae32209f43e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* [qgenericunixservices] Consider kde-open5 for opening URLsNicolas Fella2021-07-281-0/+2
| | | | | | | | | | | | | When xdg-open is not found the KDE-specific kfmclient is considered. That however is part of Konqueror and may not be present as well. Plasma offers another option, kde-open5, which should be considered before falling back to webbrowsers. This is particularly for non-http URLs like tel: where opening in a webbrowser is not wanted. Pick-to: 6.2 6.1 5.15 Change-Id: I2b606562e21568fbe43f4593de67a1d467918cc4 Reviewed-by: David Faure <david.faure@kdab.com>
* QDBusMenuConnection: Close open D-Bus connectionJonas Kvinge2021-06-302-0/+9
| | | | | | | | | | | | | | Using QSystemTrayIcon::isSystemTrayAvailable() generates a new connection from QDBusTrayIcon::isSystemTrayAvailable() with a new unique instance ID. These were never closed, so calling QSystemTrayIcon::isSystemTrayAvailable() frequently leads to crash when it runs out of file descriptors. Fixes: QTBUG-94839 Pick-to: 5.15 6.1 6.2 Change-Id: Ib71441a6b680d8633707cc02f9b6081c0f02472b Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QtGui: Fix include conventionFriedemann Kleint2021-06-021-1/+1
| | | | | | | | | Use the module in qtx11extras_p.h, qguiapplication_p.h. Pick-to: 6.1 Task-number: PYSIDE-1568 Change-Id: Iaf004d3fdad8472629d6f4d35031b517b3b735ce Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Support hardware composition for webOSElvis Lee2021-06-011-0/+4
| | | | | | | | | | | | In similar way with vsp2, the interfaces are needed to support qtwayland hardware layer for webOS. https://doc.qt.io/qt-5/qml-qtwayland-compositor-waylandhardwarelayer.html Change-Id: I14481373d696b501a774b9258da789554065a6ea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* qxkbcommon: Map Super/Hyper to Meta early enough to have an effectAndrey Butirsky2021-05-251-6/+6
| | | | | | | | | | | Super/Hyper keys are detected during a direct mapping phase, but the function returned before the translation to Meta could take place. Task-number: QTBUG-62102 Pick-to: 5.15 6.0 6.1 Change-Id: I9f7ccfd757fa86dbc648951306deb1b43ccf4167 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
* qxkbcommon: Keep lower case as Qt key when upper case is not in Latin1Andrey Butirsky2021-05-251-0/+8
| | | | | | | | | | | | | Upper-casing a Latin1 character might move it out of Latin1 range, for example U+00B5 MICRO SIGN, which upper-case equivalent is U+039C GREEK CAPITAL LETTER MU. If that's the case, then map the original lower-case character. Fixes: QTBUG-93858 Pick-to: 5.15 6.0 6.1 Change-Id: Ibd86fbb7c70d620c0884015ec1c40aa6351e6320 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
* Rejig native interface plumbingTor Arne Vestbø2021-05-124-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial approach for providing public access to native interfaces via T::nativeInteface<I>() was based on the template not being defined, and then having explicit instantiations of the supported types in a source file, so that the accessors were exported and available to the user. This worked fine for "simple" types such as QOpenGLContext and QOffscreenSurface, but presented a problem in the context of classes with subclasses, such as Q{Core,Gui}Application. To ensure that a native interface for QCoreApplication was accessible both from QCoreApplication and its subclasses, while at the same time preventing a native interface for QGuiApplication to be accessible for QCoreApplication, the nativeInterface() template function had to be declared in each subclass. Which in turn meant specializing each native interface once for each subclass it was available in. This quickly became tedious to manage, and the requirements for exposing a new native interface wasn't very clear with all these template specializations and explicit instantiations spread around. To improve on this situation, while also squashing a few other birds at the same time, we change the approach to use type erasure. The definition of T::nativeInteface<I>() is now inline, passing on the requested interface to a per type (T, not I) helper function, with the interface type flattened to a std::type_info. The type_info requested by the user is then compared to the available types in a single per-type (T) "switch statement", which is a lot easier to follow for someone trying to trace the logic of how a native interface is resolved. We can safely rely on type_info being stable between the user application and the Qt library as a result of exporting the type info for each native interface, by explicitly ensuring they have a key function. This is the same mechanism that ensures we can safely dynamic_cast these interfaces, even across library boundaries. The use of a free standing templated helper function instead of a member function in the type T, is to avoid shadowing issues, and to not pollute the class namespace of T with the helper function. Since we are already changing the plumbing for how a user resolves a native interface for a type T, we take the opportunity to add a few extra safeguards to the machinery. First, we add a static assert in the T::nativeInteface<I>() definition, that ensures that only compatible interfaces, as declared by the interface themselves, are allowed. This ensures a compile time error when an incompatible interface is requested, which improves on the link time errors we had prior to this patch, and also offsets the one downside of type erasure, namely that errors are only caught at runtime. Secondly, each interface meant for public consumption through T::nativeInteface<I>() is declared with a revision, which is checked when requesting the interface. This allows us to bump the revision when we make breaking changes to the interface that would have otherwise been binary incompatible. Since the user will never see this interface due to the revision check, they will not end up calling methods that have been removed or renamed. One advantage of moving to a type-erased approach for the plumbing is that we're not longer exposing the native interface types as part of the T::nativeInteface symbols. This means that if we ever want to rename a native interface, the only exported symbol that the user code relies on is the type info. Renaming is then possible by just exporting the type info for the old interface, but leaving it empty. Since no class in Qt implements the old native interface, the user will just get a nullptr back, similarly to bumping the revision of an interface. Change-Id: Ie50d8fb536aafe2836370caacb22afbcfaf1712a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move QtX11Extras into QtGui as private APITor Arne Vestbø2021-05-102-0/+658
| | | | | | | | | | | from qt/qtx11extras 0e67fb41cfc4b4bfbaa7dc75f8ddebdf5a08e836. The plan is to expose these as native interfaces, so this is a first step. Task-number: QTBUG-83251 Change-Id: Iecba8db9a4f616a08a3750ddaae08cc30ec66f89 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Remove duplicated declaration of QCocoaGLContext native interfaceTor Arne Vestbø2021-05-061-7/+0
| | | | | | | | The interface is already declared in qopenglcontext_platform.h, so the inclusion in qcocoanativeinterface.mm was unintentional. Change-Id: Ic6d4a86527d03787efd858c1a6568933be8a4327 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't own unique name for QDBusTrayIconIlya Fedin2021-04-212-14/+5
| | | | | | | | | | | | | | | | | | Flatpak doesn't allow to own random name with PID. Even after adding such a permission into manifest, all flatpaked apps have PID 2, so only one Qt application at a time can have tray icon. Even though unique name is a part of the spec, no tray hosts really check it and SNI implementations without unique name run just fine inside and outside of Flatpak. This fixes the inability of Qt applications to have tray icon in Flatpak outside of KDE. Pick-to: 6.0 6.1 5.15 Change-Id: Ieea6dc335b7a74537a51929f6e70ca68c84228fb Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix GLX on non-linux X11 systemsNiclas Rosenvik2021-04-111-2/+2
| | | | | | | | | | | | | Some parts of the GLX code is only enabled for Linux. This makes builds on other X11 supported platforms break when GLX is found. To fix this enable these parts of the code when Qt feature xcb-glx-plugin is enabled. xcb-glx-plugin has to be made public in order for QT_CONFIG(xcb_glx_plugin) to work correctly in these parts of the code. Change-Id: I6bf78b6a64787ed88c8e2fae40675244c9198c37 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Merge integration refs/builds/qtci/dev/1617813097Qt CI Bot2021-04-072-8/+8
|\
| * fix Alt+` shortcut on non-US layoutsAndrey Butirsky2021-04-072-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible for non-letter-keys with Latin 1 symbols (`, !, @ etc.) to participate in shortcuts also, when the keys generate national symbols on non-Latin layout. For example, in Russian layout, "`" key generates cyrillic "ё" letter of national alphabet, so shortcuts with the key should still work regardless of the actual layout. Fixes: QTBUG-90611 Change-Id: Id9a505210ff33a94b82511b88c30ef79f3d03913 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | indicator-application hack: fallback to dbus service checkIlya Fedin2021-04-071-0/+8
|/ | | | | | | | | | | | | | | | | | | | | | | There is a hack to work with Canonical's indicator-application tray applet. Since it implements the SNI spec partially and doesn't work with IconPixmap, the icon is broken without the hack. Unfortunately, this tray implementation is still in active use by Ubuntu; it's shipped and enabled by default on at least: * Xubuntu * Ubuntu MATE * Ubuntu Budgie (and maybe even others) Unfortunately, the check doesn't work in confined environments providing broken tray icons for snapped & flatpak'ed apps. Fortunately, snap allows checking all registered services on the host. It also fixes the check on flatpak if permissions to talk with these names are given. Pick-to: 6.1 6.0 Change-Id: Iee5d0bb610c3ff397babee89ef1ee788ac19f477 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix no mapping for SysReq keyAndrey Butirsky2021-03-251-0/+1
| | | | | | | | | | | | | | | | | XKB_KEY_Sys_Req keysym is currently unmapped to any Qt::Key. Implication of this it is uncapable to participate in any keyboard shortcuts. This patch adds the missing mapping. Detected by testXkb KWin unit test Fixes: QTBUG-92087 Pick-to: 5.15 6.0 6.1 Change-Id: I2440c218e265c5636fc1d2703f14d8bfe033967e Reviewed-by: Andrey Butirsky <butirsky@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
* Doc: Use correct include for QWGLContextPaul Wicking2021-03-041-1/+1
| | | | | | | Pick-to: 6.1 6.0 Task-number: QTBUG-91500 Change-Id: If487a2d14dd61d127dc35aa039f9b71915128da1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Specify correct include for QWGLContextPaul Wicking2021-03-031-0/+1
| | | | | | | Pick-to: 6.1 6.0 Fixes: QTBUG-91500 Change-Id: Ie842c9e911fe5492cc13aeba459d28d6553438fd Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* iOS: Pass the text to handleExtendedKeyEvent when knownAndy Shaw2021-02-232-2/+6
| | | | | | | | | This will ensure that the QKeyEvent also has this information passed on as appropriate. Pick-to: 6.1 Change-Id: I52436404115b453664b9b3414f8ec4e715dd6a28 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Don't assume NSEvent charactersByApplyingModifiers: produces characterTor Arne Vestbø2021-02-051-2/+5
| | | | | | | | | | In cases where the keyboard layout doesn't have a mapping for a given event and modifier combination the result will be an empty string. Fixes: QTBUG-90683 Pick-to: 6.0 Change-Id: Ice06241f0ae71a19cde041410818decc312bc630 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Don't wrap key event keys in QCharTor Arne Vestbø2021-02-052-13/+17
| | | | | | | | | | | | | | | | | | | | | | | Key events have a wider range of possible values than the unicode range, as they also include all the special keys as defined in Qt::Keys. Instead of turning the argument to keyMapForKey into an integer, we can remove the argument completely, as it was only used as a fallback in the cases where UCKeyTranslate (or in the future, charactersByApplyingModifiers:), failed to map the virtual key and modifiers to a character. But in those cases we should not fall back to the Qt key from the key event, as that doesn't match what the keyboard layout defines. Most keyboard layouts explicitly define the base key as the key for these "undefined" mappings, but if the keyboard layout does not, we should not produce any input in the application, to match what AppKit does in this case. Fixes: QTBUG-90315 Pick-to: 6.0 Change-Id: Ib9ffd9521049ee8e4b103597c1d34cbe3d23dbdf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Add "we mean it" warning to private headerVolker Hilsheimer2021-02-031-0/+11
| | | | | | | Fix warning from configure. Change-Id: I12def11a4effb7298ec0501cfac4ffd37b777ff6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix inefficient use of qToBigEndianAllan Sandfeld Jensen2021-02-021-4/+1
| | | | | | | It can do unaligned access directly as well. Change-Id: I4046cf69e2ad8eb628b8b53bfa521800bb35dc6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* iOS: Handle keyboard events when using an external keyboardAndy Shaw2021-01-202-0/+756
| | | | | | | | | | | | | | | | | | This enables the two possible approaches for handling external keyboard events. While support still exists for before 13.4 then both approaches are needed. This ensures that all external keyboard events are handled as key events and passed on accordingly. Additionally, this accounts for possible shortcuts too, therefore a new function is added to QShortcutMap to aid that. As a result, code has now moved from QCocoaKeyMapper to be part of the gui/platforms/darwin part to make it easier to reuse this code elsewhere. Fixes: QTBUG-85727 Change-Id: I349af43468b03fd8dcb16adba02669974affe154 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix XCB launch key mappingAllan Sandfeld Jensen2021-01-151-18/+17
| | | | | | | | | | | | | They have been reported wrong since Qt 4, and not fixed for behavior compatibility, fixing it for Qt 6. [ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names and X11 names match, instead of being 2 off. Pick-to: 6.0 Fixes: QTBUG-25261 Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Remove QtDBus includesDavid Skoland2021-01-127-66/+79
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Pick-to: 6.0 Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-079-96/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-302-6/+6
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Doc: Fix documentation warnings for Qt GUITopi Reinio2020-11-193-7/+27
| | | | | | | | | | | | | | | - Remove obsolete dependencies and references. - Restore previously deleted snippet code referenced in richtext.qdoc. - Add widgets snippets path to exampledirs; some classes were moved from QtWidgets to QtGUI and related \snippet commands were broken. - Mark internal functions under QNativeInterface::Private as \internal. Task-number: QTBUG-86295 Change-Id: I9c165c860c7191dac65972d702698a1745bff77f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* name our glib event sources to ease debuggingAndreas Buhr2020-10-221-2/+5
| | | | | | | | | | | glib event sources can have a name, but it is not required. Internal to glib, it is common to give them a name, see for example https://git.io/JTZ8g . This patch gives a name to each glib event source created in qtbase. Task-number: QTBUG-84291 Change-Id: I4f04526dcec082242312e3a66da2adf37a22e626 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* OpenFile portal: use "writable" option to specify our FD is writableJan Grulich2020-10-211-2/+4
| | | | | | | | | | | | | When using OpenFile portal and passing a file descriptor, we open the file with qt_safe_open() which by defaults make the file descriptor writable. However we didn't specify in options that the FD is writable which leads into rejection on xdg-desktop-portal side as there is a mismatch between writable FD and read-only request. Pick-to: 5.15 Change-Id: I7a430339a9615f0a054e777e0f3de56e219d1706 Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix crash in tst_QSystemTrayIcon::lastWindowClosed()Allan Sandfeld Jensen2020-10-201-0/+2
| | | | | | | | | Handle null QIcons. Note this was already fixed in 5.15 separately, see 6c8adfaf5dc. Fixes: QTBUG-87729 Change-Id: Ia759fbe95fafcea9451d393dc1aa077f5651919b Reviewed-by: Liang Qi <liang.qi@qt.io>
* doc: Update and flesh out native interface docsTor Arne Vestbø2020-10-184-6/+418
| | | | | | | | | The namespace and overviews are in the qtdoc repository. Docs for individual interfaces should live with their platform. Change-Id: Iba5fd7e9ebc4f1f634ec9dc3ec125ce88a1312ba Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* macOS: Always include non-GL native interfacesTor Arne Vestbø2020-10-121-3/+4
| | | | | Change-Id: Idc8e76b5cb7af8b8df54820a4150ac7d1e3d8944 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>