summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
Commit message (Collapse)AuthorAgeFilesLines
* iOS: Always call setParent during QIOSWindow constructionTor Arne Vestbø25 hours1-2/+4
| | | | | | | | | | | | | We rely on setParent for parenting top level windows into our desktop manager view, so we can't condition the call on having a parent window, like we do on other platforms. This was a regression from 988039729f55a5e62e32b82c6f29ff7457e91d9d. Fixes: QTBUG-125142 Pick-to: 6.7 Change-Id: I2884d77db09cba5371ccd77eabda7ce38c0292de Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QIOSDocumentPicker: Directly add UTTypes to document types arrayDoris Verria3 days1-4/+4
| | | | | | | | | We don't need to create UTTypes from identifiers when we can now directly add the UTType to the array. In fact this way was causing an exception since it couldn't cast a UTType to a NSString type. Change-Id: I34d44422c102df84a625945af218b9c25c1a6895 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QIOSTextInputOverlay: Use new presentationWindow to access keyWindowDoris Verria3 days1-1/+1
| | | | | | | | | Accessing the keyWindow through UIApplication keyWindow was causing a crash. Fixes: QTBUG-125089 Change-Id: Ie02afd7875b490c1f72ff2e827ffa2204d0e9e81 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* iOS: Decouple UIWindow management from QIOSScreenTor Arne Vestbø2024-04-198-49/+108
| | | | | | | | | | | | | | | | | | | | We now adopt the UIScene lifecycle, where we react to iOS creating UIWindowScenes for connected screens, which we then configure with a single instance of our QUIWindow, that in turn contains the QIOSViewController and QIOSDesktopManagerView that we depend on for our window management. As a result, we can now create and show QWindows on visionOS, which doesn't have UIScreen and hence failed with our old strategy managing our UIWindow via UISScreen. We still do not declare a UIApplicationSceneManifest in our Info.plist, or report UIApplicationSupportsMultipleScenes, as this adds another level to the window management that we're not ready for yet. Task-number: QTBUG-121781 Change-Id: Ic02f43aa6b205289a3f3c8e72c2a6ef575031d9a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QWindow: Persist foreign winId to support destroy/create cyclesTor Arne Vestbø2024-04-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | We used to set a private _q_foreignWinId property on QWindow when creating foreign windows, and this was the mechanism which we then passed the foreign winId to the platform plugin. With c585802e946d97e7d177ea334a162dc7bc286b84 this was removed, since we now were passing the winId through via explicit QPA APIs, and since 0c6911e5cde24c45d6f2c08b6e71064bdd1eccfa removed the ability to explicitly destroy() a foreign window. But when closing a QWindow, we destroy both the window itself, and all its children, including foreign windows. In this case we still want to support recreating the foreign window, for example when the parent window is shown again. To enable this we restore the _q_foreignWinId private property, but keep the limitation of not being able to explicitly destroy a foreign window. Pick-to: 6.7 6.5 Fixes: QTBUG-124160 Change-Id: Ia885ba9f043e64fb21eedd2b4c344679726f1b5c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Disable copy and move of QAbstractFileEngineHandlerEdward Welbourne2024-04-191-0/+3
| | | | | | | | | | | | They're not wanted and Axivion (SV71) grumbles about the lack of copy and move operators and constructors otherwise. Do the same in all derived classes. Some of these needed their default constructors made overt as a result. Similar for QAbstractFileEngineHandlerList. Task-number: QTBUG-122619 Change-Id: Iff016940f8c4884bd65dd781354b9bcda9b7cdd8 Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* iOS: Don't report UIDevice.currentDevice.orientation through QScreenTor Arne Vestbø2024-04-182-76/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | As of Qt 6 (3e12951c0b35041920989d6089ddb6c2f5c2d3d1, the QScreen's orientation() property is supposed to represent the orientation of the screen from a window management perspective, and not the orientation of the actual device, as in Qt 5 times. For iOS, when the orientation of the app is locked to a orientation via the Info.plist or [UIViewController supportedInterfaceOrientations], the UIDevice API will keep reporting the actual orientation of the device, which is wrong for the Qt 6 definition of the API. We currently don't have an API in QScreen to represent the always updating physical rotation of the device. For this use-case the supported API is QOrientationReading in Qt Sensors. [ChangeLog][iOS] QScreen::orientation() will no longer report the device's physical orientation when orientation has been locked to a subset of the available orientations, but will instead match the primary orientation. Task-number: QTBUG-38576 Task-number: QTBUG-121781 Change-Id: I251a039a618656466cbfd1d836a5b49a6be8e736 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: Remove plumbing for QWindow::reportContentOrientationChangeTor Arne Vestbø2024-04-185-105/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The [UIApplication setStatusBarOrientation:animated] API has been deprecated since iOS 8, and a no-op since iOS 13. It is no longer possible to report the orientation of a view or view controller independently of the orientation of the view itself. This was problematic because we were applying additional logic to our screen geometry mapping based on the assumption that the API was still doing something, resulting in broken auto rotation when calling reportContentOrientationChange(). Removing the iOS implementation for reportContentOrientationChange makes this API a no-op on QWindow as well, as no other platforms seem to implement it. We should perhaps consider re-thinking the screen orientation APIs in this light. [ChangeLog][iOS] QWindow::reportContentOrientationChange no longer has any effect on iOS, as the APIs used to implement this on iOS are no longer available. Task-number: QTBUG-38576 Task-number: QTBUG-121781 Change-Id: I5b129d21c990332170599c2580e389e252140d6f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* iOS: Move QUIWindow implementation out of qiosscreen.mmTor Arne Vestbø2024-04-187-49/+73
| | | | | | | | Task-number: QTBUG-121781 Change-Id: Iaa4388908d0d59022ec05b63696147a0d1d01ae1 Reviewed-by: Amr Elsayed <amr.elsayed@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* iOS: Handle geometry of maximized windows outside of QIOSScreenTor Arne Vestbø2024-04-184-37/+40
| | | | | | | | | | | | | | | Ideally we would report the available geometry of our screen in a way that reflects the safe area margins of a potentially full screen window, but doing so requires that we manage UIWindows via QScreen/UIScreen, which is not in line with modern iOS window management. We still apply safe area margins to maximized windows, as before, but do so when applying the maximized state in QIOSWindow::setWindowState Task-number: QTBUG-121781 Change-Id: If7b9855aea47014f01e23dfe197b7057a1305a68 Reviewed-by: Amr Elsayed <amr.elsayed@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* iOS: Support message box at startup without relying on screen's windowTor Arne Vestbø2024-04-182-20/+17
| | | | | | Task-number: QTBUG-121781 Change-Id: Iafc911dad6c668799383f423e38ab389c29688b4 Reviewed-by: Doris Verria <doris.verria@qt.io>
* iOS: Reduce dependency on screen's UIWindow in QIOSScreen::grabWindowTor Arne Vestbø2024-04-181-6/+6
| | | | | | | | | | | We still fall back to m_uiWindow for grabbing the entire screen, but the rest of the logic is now agnostic to where the window of the view is coming from. Task-number: QTBUG-121781 Change-Id: If8815f62d22a1d4bbdfe6fe24ddadce2223c8623 Reviewed-by: Amr Elsayed <amr.elsayed@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: Track virtual keyboard gestures via focus window instead of screenTor Arne Vestbø2024-04-181-9/+6
| | | | | | | | | | | We're moving away from the screen managing a UIWindow, so let's track the UIWindow via the focus window instead. Task-number: QTBUG-121781 Change-Id: I943b1d501f743c51b3f1484aecbe008c6dae8cd4 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
* Add preliminary support for Qt for visionOSTor Arne Vestbø2024-04-1819-66/+161
| | | | | | | | | | | | | | | | | | | | | | Qt already runs on Vision Pro as "Designed for iPad", using Qt for iOS. This change enables building Qt for visionOS directly, which opens the door to visionOS specific APIs and use-cases such as volumes and immersive spaces. The platform removes some APIs we depend on, notably UIScreen, so some code paths have been disabled or mocked to get something up and running. As our current window management approach on UIKit platforms depends on UIWindow and UIScreen there is currently no way to bring up QWindows. This will improve once we refactor our window management to use window scenes. To configure for visionOS, pass -platform macx-visionos-clang, and optionally add -sdk xrsimulator to build for the simulator. Change-Id: I4eda55fc3fd06e12d30a188928487cf68940ee07 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QFileSystemEngine: make factory functions return unique_ptr<QABFE>Ahmad Samir2024-03-211-3/+3
| | | | | | | | | | | | | | | | This makes the ownership of the returned pointer clearer. It also matches reality, some call sites were already storing the pointer in a unique_ptr. Also shorten the function name to "createLegacyEngine", you have to read its docs anyway to figure out what it does. Drive-by changes: less magic numbers; use sliced(); return nullptr instead of `0`. Change-Id: I637759b4160b28b15adf5f6548de336887338dab Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QAbstractFileEngineIterator: add `bool advance()` virtual methodAhmad Samir2024-03-201-7/+5
| | | | | | | | | | | | | | | | | | | | | | | And remove hasNext/next() methods. This remodels QAFEI to be like QFileSystemIterator. This better fits the logic in the newly added QDirListing class (which uses STL-style iterators). QFSFileEngineIterator: Initialize the internal nativeIterator in the constructor; also replace the advance() private method with an override for the advance() method inherited from the base class. QResourceFileEngineIterator: Override currentFileInfo(), with a QResouces the QFileInfo is created on demand if/when this method is called. This is the backend/private API, and QDirListing is the public API that can be used in a ranged-for to iterate over directory entries. Change-Id: I93eb7bdd64823ac01eea2dcaaa6bcc8ad868b2c4 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* iOS: Don't apply UIWindow safeAreInsets to available geometry on visionOSTor Arne Vestbø2024-03-201-5/+20
| | | | | | | | | | | | | | | | | | | There is no concept of a screen on visionOS, and hence no concept of screen-relative system UI that we should keep top level windows away from. As UIWindow and UIScreen on visionOS report the exact same bounds, we can't use the same code path we use for iOS/iPadOS to detect whether to apply the safe area insets, so skip the logic entirely. We still report the safe area insets on a QWindow level, so applications can avoid rendering content close to UI elements such as the window move and window close buttons. Task-number: QTBUG-121781 Change-Id: I20ad02390564972a3715c27f351689b79ad579d8 Reviewed-by: Amr Elsayed <amr.elsayed@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: Compute screen available geometry without UIScreen.applicationFrameTor Arne Vestbø2024-03-201-22/+9
| | | | | | | | | | | | | | | | | | | | | | | | | The API has been deprecated for a long time, and doesn't have the same semantics as we want for modern iOS apps that may run in windowed mode on iPad, macOS, or visionOS. Instead we base the availableGeometry exclusively on the safeAreaInsets of the screen's UIWindow. But we only do so if the UIWindow bounds match the bounds of the UIScreen in each dimension. This means that iOS apps that take up the entire screen, or run in Split View on iPad, will get a smaller availableGeometry, but apps that run in Slide Over on iPad, or windowed in Stage Manager on iPad, will get an availableGeometry that matches the entire screen. It's then up to the QWindow to take the safeAreaMargins into account when rendering, to stay out of any UI elements that the OS may add. We do this for QWidgets with layouts automatically, and the plan is to do this for Qt Quick Controls as well. As the current situation is quite broken anyways, we take the first step now, and then follow up with the Quick changes later on. Task-number: QTBUG-121781 Change-Id: I7728e117969474654fcccdb19a6c954bb0eea3f9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: Use UIWindow bounds for fullscreen/maximized geometry on macOSTor Arne Vestbø2024-03-191-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In modern iPad apps, windows can be moved between screens, just like regular macOS apps, but we don't reflect this as changes to the QWindow's screen, meaning the screen() is not reliable input when computing a window's full screen or maximized geometry. In addition, when running iOS apps on macOS as "Designed for iPad", the system will scale the UI down by 77%, to better match metrics (fonts, sizes) to the macOS environment. Classes like UIView and UIWindow are oblivious to this scaling, and will think they are larger than what they really are on the screen. However, UIScreen, for some reason, reflects the actual screen size, instead of taking part in the "inflated" view of the world. As a result, even if screen() would reflect the correct screen the window is on, we can't use the screen geometry for clamping the window geometry, as the two have separate coordinate systems. We could scale up the QScreen geometry accordingly to work around this, but we don't know if the UIScreen behavior is a bug or not, so instead we skip the screen() as input and use the UIWindow bounds directly. Task-number: QTBUG-121781 Fixes: QTBUG-106709 Pick-to: 6.7 6.6 6.5 Change-Id: Ie734fc477b37a7e39e6fb16d7738d3f69731a975 Reviewed-by: Amr Elsayed <amr.elsayed@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: Replace deprecated UTType constantsTor Arne Vestbø2024-03-191-4/+4
| | | | | Change-Id: Ia610d46cf36292327ef87645af7516754eb1c79c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: Remove support QClipboard::FindBufferTor Arne Vestbø2024-03-191-31/+8
| | | | | | | The Find pasteboard has been unavailable on iOS since iOS 10. Change-Id: I05d5ae49b3a733144ac5c35970ff4a3c62923650 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: Remove NSView.safeAreaInsets wrapperTor Arne Vestbø2024-03-194-8/+2
| | | | | | | | | The API is available on all iOS versions we support nowadays. Pick-to: 6.7 6.6 6.5 Change-Id: Ia58c5ad1649e7e6b22f9c56a809e2455586a8e5a Reviewed-by: Amr Elsayed <amr.elsayed@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* QAbstractFileEngine: add a path parameter to beginEntryList()Ahmad Samir2024-03-172-5/+6
| | | | | | | | | | | | | Change beginEntryList() to take a path parameter, which it passes on to the QAFEIterator constructor; setting the path at construction makes more sense, because typically the path isn't supposed to change during iteration, and this simplifies the code at the call site. Remove setPath(), the last usage in Qt repos was in QtCreator, and that has been ported away from it. Change-Id: I01baa688e0f9b582aacb63d7d98a794276e58034 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAbstractFileEngine: make {begin,end}EntryList() return a unique_ptrAhmad Samir2024-03-172-4/+5
| | | | | | | | Makes ownership clearer. Change-Id: Ibb57ca900ef30b16d48964a977e997ba6705248b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QAbstractFileEngine: remove redundant endEntryList() overridesAhmad Samir2024-03-032-6/+0
| | | | | | | | QAFE sub-classes endEntryList() overrides returned nullptr, which is exactly what the base class implementation does. Change-Id: I2e901647cd087c3b8ba674db6e7b371e620af340 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* iOS: Propagate focus changes to VoiceOverTor Arne Vestbø2024-02-155-5/+31
| | | | | | | | | | | | | | | | | | | | | Changing the focus object should update the VoiceOver focused element, the same way we do it on macOS. There's no NSAccessibilityFocusedUIElementChangedNotification on iOS, but we can pass the focused element as an argument when posting the UIAccessibilityLayoutChangedNotification. The class method on QMacAccessibilityElement to get an element for an QAccessible::Id was not used by any callers, and has been modified to resolve the container from the QAccessibleInterface, so that we don't need to plumb that all the way from the focus change event. Inspired-by: Jan Möller <jan.moeller@governikus.de> Fixes: QTBUG-114608 Pick-to: 6.7 6.6 6.5 Change-Id: I2e43ae649bc7e3a44c1e1200e8de66bf420b1949 Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove extra semi-colonsTasuku Suzuki2024-02-061-2/+2
| | | | | Change-Id: I92fddb36cd136fd1bd627955f15d0559b9942d7e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* iOS: Guard traitCollectionDidChange against lack of QGuiApplicationTor Arne Vestbø2024-02-051-0/+3
| | | | | | | | | | During shutdown we may get traitCollectionDidChange for our QUIWindow, as it may outlive the QGuiApplication and the QWindows due to hanging around in an auto-release pool. Pick-to: 6.7 6.6 6.5 Change-Id: Ifc6471b933fb1b4d1e83e9b734aac31044dce03e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* iOS: Guard against displayLayer after platform window is goneTor Arne Vestbø2024-02-051-0/+3
| | | | | | | | | | During shutdown the UIView might outlive its QIOSWindow platform window. If we receive displayLayer calls, we need to bail out, to avoid crashing when trying to send the expose event. Pick-to: 6.7 6.6 6.5 Change-Id: I2f36a4dd825e91b348bc57a06e6aa6b1a12fd249 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* iOS: Remove QUIView from superview on QIOSWindow destructionTor Arne Vestbø2024-02-051-4/+5
| | | | | | | | | | | | | | | | Unlike on macOS, our UIViews are children of a QIOSDesktopManagerView that we use to do window management, so we need to remove the view from its superview, even if represents a top level QWindow. The only exception is top level foreign windows, which are used to represent a native UIView for the purpose of containing a Qt view hierarchy within. As we don't know anything about the foreign view's superview hiearchy we shouldn't touch it. Pick-to: 6.7 6.6 Fixes: QTBUG-120369 Change-Id: I6a43bb0a4e72d0d1525a7cc33d572ea7477215b3 Reviewed-by: Doris Verria <doris.verria@qt.io>
* iOS: Avoid category method name clash for UIResponderPaul Heimann2024-01-116-12/+12
| | | | | | | | | | | | | | As described in Apples documentation, own methods which are added to existing classes should be prefixed to avoid category method name clashes. This prefix was missing from the function currentFirstResponder() which caused issues when closing the virtual keyboard on some iOS devices. (see https://developer.apple.com/library/archive/qa/qa1908/_index.html) Pick-to: 6.7 6.6 6.5 Task-number: QTBUG-119601 Change-Id: I82fb8a8beeb0a3234594357f1e1db67b0ae3da36 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QIcon: turn platform engines on by defaultVolker Hilsheimer2023-12-071-4/+1
| | | | | | | | | | | | | | | | | | | | | | They are used when an icon is constructed via QIcon::fromTheme, unless an application-defined theme provides the requested icon. Update the documentation. For now we don't provide a way to "opt out". This might change, depending on the feedback during the Qt 6.7 beta phase. [ChangeLog][QtGui][QIcon] Qt now has implementations of native icon engines for macOS, iOS, Windows 10, Windows 11, and Android. These engines provide access to the native icon libraries and fonts, mapping standard icons to the corresponding native icon asset. Icons from application-defined themes take precedence, but the last-resort fallback icon passed as the second parameter into the QIcon::fromTheme(QString, QIcon) overload is only used if the icon is not available from the native library. See the QIcon documentation for details. Change-Id: I618e5c137c40f8e6309c0e4d4219a5a2759a475d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* iOS: Allow raising and lowering child windowsTor Arne Vestbø2023-12-061-11/+19
| | | | | | | | | | | If the view's superview is not our own QIOSDesktopManagerView then it's either a child window, or the view of a view controller that's not our own. In both cases we can skip the logic to include the window level, as that only applies to Qt top level windows. Pick-to: 6.6 6.5 Change-Id: If8bbf2a79f3be0cbaf6979455b0626b36da71068 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Rename QWSI::handleWindowActivated to QWSI::handleFocusWindowChangedTor Arne Vestbø2023-11-231-2/+2
| | | | | | | | | | | | | | | | | | | A single QWindow is QGuiApplication::focusWindow() at a time, and this window is typically also QWindow::isActive(), but other windows may also be QWindow::isActive(). For example, we treat any sibling or ancestor of the focusWindow as being QWindow::isActive() as well. In addition, in the case of non-QWindow child windows, we may have to query the platform for the activation state, which means we also need a way for the platform to reflect changes in this state through QWSI. The current API for this, QWSI::handleWindowActivated, is in practice a focus window change API, so as a first step let's rename it to better reflect what it's doing. Task-number: QTBUG-119287 Change-Id: I381baf8505dd13a4a829c961095a8d2ed120092b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add initial implementation of macOS and iOS icon theme implementationsVolker Hilsheimer2023-11-232-0/+10
| | | | | | | | | | | | | | | | | | | | | | | From macOS 13 on, AppKit provides an API to get a scalable system image from a symbolic icon name. We can map those icon names to the XDG-based icon names we support in Qt, and render the NSImage with palette-based coloring when needed, in an appropriate scale. On iOS, we can use the equivalent UIKit APIs. Coloring functionality is only available from iOS 15 on. Implement a QAppleIconEngine that does that in its scaledPixmap implementation. Use basic caching to store a single QPixmap version of the native vector image. We regenerate the pixmap whenever a different size, mode, or state is requested. Add a manual test for browsing all icons we can get from the various Qt APIs that: standard icons and pixmaps from QStyle, QPlatformTheme, and QIcon::fromTheme, in addition to showing all icon variations for a single QIcon. Task-number: QTBUG-102346 Change-Id: If5ab683ec18d140bd8700ac99b0edada980de9b4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* iOS: Use 160x160 as default normal window size, like on other platformsTor Arne Vestbø2023-11-201-5/+7
| | | | | | | | | | | | For top level windows, the window size will still reflect the screen's available geometry, as the window state will be maximized by default. [ChangeLog][iOS] The default normalGeometry() of a window is now 160x160, instead of following the screen geometry. Top level windows are still maximized by default, as before. Change-Id: Ice752f74d943bf4fbb9be9e39f07798431fc2b0c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Prevent reparenting of foreign window embedding containerTor Arne Vestbø2023-11-151-1/+6
| | | | | | | | | | | A foreign window used to embed a Qt window into it should not end up with changes to its own parent, as its only job is to give the embedded Qt window a parent handle. Pick-to: 6.6 Change-Id: If1bc89658fedf449d266bc0cc750c90b6a841a68 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Ensure foreign window can be reparented out of contained window againTor Arne Vestbø2023-11-131-4/+10
| | | | | | | | | A foreign window embedded into a Qt hierarchy must also support being removed from that window hierarchy. Pick-to: 6.6 Change-Id: Id4d08079ff19d67a8989937bc72602e8bd14b31b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* iOS: Fix foreign window auto testTor Arne Vestbø2023-11-132-11/+23
| | | | | | Pick-to: 6.6 Change-Id: Iae3a0f9805b02f935009d800dec00d9e2ceb008d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* iOS: Make nextTouchId static, unsigned and let it overflowShawn Rutledge2023-11-091-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | If an application has two windows, and the user tries to do multi-touch gestures with different fingers in each window at the same time, we want the touchpoint IDs to be unique. m_nextTouchId was a per-window variable before; the result was that the QEventPoint delivered to the second window was replacing values (including QEventPointPrivate::window) in the persistent QEventPoint that was still being held in the first window; then when the release of the first point occurred, QGuiApplicationPrivate::processTouchEvent() saw its destination window pointer as null because the second touchpoint had already been released. QEventPoint::id is of type int, with negative values being invalid. nextTouchId is of type quint16 so that it will always be positive, and we can let it eventually overflow (wrap back to 0) rather than resetting it to 0 after each touch gesture. The only requirement is that the IDs need to be unique and positive (and typically they are sequential: that makes debug output easier to understand). Task-number: QTBUG-118909 Change-Id: Ia0f1edc9a5e2b362028bed4418fed228814cddb6 Pick-to: 6.5 6.6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Include what you need: <QPointer>Marc Mutz2023-10-125-0/+9
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I3321cccdb41ce0ba6d8a709cea92427aba398254 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* platform plugins: use string view types moreAnton Kudryavtsev2023-10-081-2/+2
| | | | | | | Change-Id: I793cfff1afca6b98a672615e33a19f8210e429dd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* ios: Fix crash when closing app while showing a native screenAlbert Astals Cid2023-09-131-1/+4
| | | | | | | Fixes: QTBUG-117021 Pick-to: 6.6 6.5 Change-Id: Icebae0e815b42c6e0bf39e727fd1a16db5752d78 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qiosclipboard: use const methods moreAnton Kudryavtsev2023-09-091-2/+4
| | | | | | | to avoid imlicit detach. While touching code, add reserve usage Change-Id: I9dcd916f2210537c3f1d695e3e68b53da735d978 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Mark all of Qt as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses in this and some other modules is still extremely high, too high for anyone to tackle in a short amount of time. Even if they're not concentrated in just a few TUs, we need to make progress on a global QT_NO_FOREACH default, so grab the nettle and stick to our strategy: Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the #undef QT_NO_FOREACH to indicate that these actually test the macro. Task-number: QTBUG-115839 Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* iOS: Add support for foreign windowsTor Arne Vestbø2023-08-184-13/+55
| | | | | | | Task-number: QTBUG-116183 Pick-to: 6.6 Change-Id: Ia92ee2d15f2e91a326ad342237fb0a83305c019f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Rename accent color in QPaletteSanthosh Kumar2023-08-181-1/+1
| | | | | | | | | | Accent color role has been renamed according to name rule of other color roles in QPalette. Fixes: QTBUG-116107 Pick-to: 6.6 Change-Id: I70ac98a1e97afbdc7ea5f8d79f808c307e170712 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Mark ios plugin as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-085-0/+15
| | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses is high here, too high for this author to tackle in a short amount of time. But they're concentrated in just a few TUs, so pick a different strategy: Mark the whole plugin with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. Since the TUs are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). I'm aware that Objective-C/C++ files are currently probably implicitly NO_PCH_SOURCES, but don't rely on that. Task-number: QTBUG-115839 Change-Id: If451501f3cb7cc3a182854a94bc5d27c907f6161 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* iOS: Implement QPlatformWindow::setMask() for masking rendering and inputTor Arne Vestbø2023-08-072-0/+20
| | | | | | | | | | | | Same implementation as for macOS. [ChangeLog][iOS] QWindow::setMask() is now supported for masking the rendering and touch input of child windows. Pick-to: 6.6 Change-Id: I2f9429f0f8fa278fdd8edc15c7b242c7c6bc0ff0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: Add version check when setting accent colorDoris Verria2023-07-101-1/+2
| | | | | | | | | UIColor.tintColor is only available on iOS 15.0 or newer. Ammends commit 69cc7f946a66527c3f2b7a28510dcb37459dc33a Pick-to: 6.6 Change-Id: Id82006629ee3c3d2548ea39afde265cdccf2cdab Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>