[Interest] How to disable multi touch for iOS

sivan nanthiran nanthiran2005 at gmail.com
Fri Nov 25 05:33:36 CET 2022


Apologies for the missed part. I noticed that this issue only happens with
these specific conditions.

1) A mainwindow (QMainwindow) that has both native widget and a normal
QWidget as shown in the screenshot below. The middle gray widget is a
native widget.
2) setAttribute(Qt::AA_DontCreateNativeWidgetSibling) is set to QApplication
3) In QMainWindow,

setWindowFlag(Qt::MaximizeUsingFullscreenGeometryHint, true);

setAttribute(Qt::WA_COntentsMaginsRespectsSafeArea, false);


I believe there is something to do with the safe area in iOS as now I have
placed my buttons at the bottom edge which overlaps on the safe area. The
only problem now is that when the touch is received by the native widget
(middle), and while the touch is still on, I can still use another finger
to click on my push buttons.

This issue does not happen if
-  I move the buttons to higher position or
- Remove the settings in 3) above

Regards,
Sivan

On Thu, Nov 24, 2022 at 3:47 PM sivan nanthiran <nanthiran2005 at gmail.com>
wrote:

> Hi,
>
> I am using Qt (not QtQuick) to develop an iOS app. I have been trying to
> find a way to disable multitouch in the widget so that no 2 widgets can
> receive touchEvent/mousePressEvent at the same time.
>
> I have tried setting *UIView.multipleTouchEnabled = false * but I am no
> longer getting QGestureEvent. I believe this is because Qt's gesture is
> depending on the multiTouch
> I have also tried setting *UIView.exclusiveTouch = true *however this
> only works for native widget or windows within a same level parent. So if I
> have a Native widget and a QPushButton within a window, I have no way to
> set the flag to QPushButton.
>
> Is there any way to achieve what I am looking for?
>
> Thanks in advance for your help.
>
> Regards,
> Sivan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20221125/457f9b42/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2022-11-25 at 12.25.24 PM.png
Type: image/png
Size: 286764 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20221125/457f9b42/attachment-0001.png>


More information about the Interest mailing list