iOS not receiving touchEvent at app start up
-
I'm porting my Qt 5.7.1 application to iOS, So, to clarify it's working fine on Android and Desktop (macOS). I'm using XCode 8.2 on Sierra. Using the iOS 10.2 SDK. I'm building and launching the app from XCode but also using Qt Creator as my man IDE as there are other platforms in there to support.
When my application starts no touch events are received although I see all the usual events. The "platform_opengl_window" referenced in the debug log is derived from QWindow and my own "i_platform_window_opengl" interface (for various porting and testing reasons).
The weirdness is this. The app receives no touch events until I swipe up from the bottom of the screen to open the iOS "utility" panel (not sure what it's proper name is). At which point my application becomes inactive (this is good!) and then I DO start to receive touch events.
Here's a debug log. I would appreciate some insight. I shall continue debugging!
platform_window_opengl.cpp:190:event: QEvent::Type(PlatformSurface) platform_window_opengl.cpp:190:event: QEvent::Type(Show) platform_window_opengl.cpp:190:event: QEvent::Type(FocusIn) platform_window_opengl.cpp:190:event: QEvent::Type(InputMethodQuery) platform_window_opengl.cpp:190:event: QEvent::Type(InputMethodQuery) platform_window_opengl.cpp:190:event: QEvent::Type(InputMethodQuery) platform_application.cpp:74:on_applicationStateChanged: Qt::ApplicationState(ApplicationActive) platform_window_opengl.cpp:190:event: QEvent::Type(Resize) platform_window_opengl.cpp:190:event: QEvent::Type(Expose) platform_window_opengl.cpp:190:event: QEvent::Type(ChildAdded) platform_window_opengl.cpp:190:event: QEvent::Type(Resize) platform_window_opengl.cpp:190:event: QEvent::Type(Move) platform_window_opengl.cpp:190:event: QEvent::Type(Expose) platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) ... # lots of update requests but no touch events at all ... platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) # Swipe up from the bottom of the screen to activate OS functions, app goes inactive (perfect) platform_application.cpp:74:on_applicationStateChanged: Qt::ApplicationState(ApplicationInactive) # This is the strangest bit, after the app inactive I start receiving touch events! platform_window_opengl.cpp:190:event: QEvent::Type(Expose) platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) platform_window_opengl.cpp:190:event: QEvent::Type(TouchBegin) platform_window_opengl.cpp:203:touchEvent: platform_window_opengl.cpp:190:event: QEvent::Type(TouchUpdate) platform_window_opengl.cpp:203:touchEvent: platform_window_opengl.cpp:190:event: QEvent::Type(TouchEnd) platform_window_opengl.cpp:203:touchEvent: ... platform_application.cpp:74:on_applicationStateChanged: Qt::ApplicationState(ApplicationActive) # Application back to active and everything works as it should. platform_window_opengl.cpp:190:event: QEvent::Type(Expose) platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) ... platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) platform_window_opengl.cpp:190:event: QEvent::Type(TouchUpdate) platform_window_opengl.cpp:203:touchEvent: platform_window_opengl.cpp:190:event: QEvent::Type(TouchUpdate) platform_window_opengl.cpp:203:touchEvent: platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) platform_window_opengl.cpp:190:event: QEvent::Type(UpdateRequest) platform_window_opengl.cpp:190:event: QEvent::Type(TouchUpdate)
Many thanks, Matthew.
-
Hi and welcome to devnet,
Sounds strange, I'd recommend taking a look at the bug report system to see if it's something known.
Also, are you using QtQuick or QWidget ?
-
@SGaist Hi & thanks! QWidget (sort of). I'm using none of the QWidget stuff as I have my own OpenGL/GLES code (not much of an abstraction, i like it that way as it's game code!) So I'm using QGuiApplication and QWindow as well as Qt OGL surface abstractions.
I don't use those classes directly in my code, there's a very thin abstraction layer so I can do work that I need on all platforms, notably setting up app specific persistent storage areas and kicking a derived store/restore function.
I'm trying to whittle the code down to a minimum amount required to reproduce the problem.
I'll update on Monday.
I'm no Qt noob BTW. I've done a couple of platform ports and was active at Qt Centre from about 10 years ago under a couple of different aliases. If I have to dig into the guts of Qt that's no problem.
-
@SGaist I think this ... https://bugreports.qt.io/browse/QTBUG-53874 is related.
-
Might be, note that both platforms have different backend.
Could you also test with Qt 5.7.0 ? That way it could help pinpoint whether it's something new to 5.7.1.
-
@SGaist I noticed that. That is the difference between platform plugin ios and cocoa.
I still haven't got to the bottom of the problem but instead I switched my "platform_window_opengl" to use QOpenGLWindow. That code path fixes the problem. I still don't need to pull in the widget library (don't need/use it) so for now I'm happy.
When I get a chance I'll dig into the implementation of QOpenGLWindow vs QWindow (with own context creation) to see what functionality is missing.
Does it still sound worthy of bug repoting to you?
-
Yes please. Even if the recommended way to build mobile UI is QML, it's better to have that kind of stuff known.
-
hi,
now i start qt basic programming,can i use c sharp .dl
l in qt programming ? -
@matthew-kuiash sure thing, I understand. Ok, so there was something going on with 9.3. I think it's still worth mentioning.
@Rameshguru Please don't highjack other people threads with completely unrelated questions, open your own threads.
-
@SGaist Done https://bugreports.qt.io/browse/QTBUG-58014
Thanks for your help with this "heisenbug"
-
@SGaist how to use .dll any possibility is there
-
-
oh sorry ,i don't know
-
Since it's C# related, go to General and Desktop. On the top left there's a big blue button call
New Topic
.