QTimer not work
-
wrote on 23 Aug 2024, 18:45 last edited by
QTimer function does not work on android as it used to.
Timeout is not called. -
Hi,
You might want to be more detailed.
Which version of Qt ?
Which version of Android ?
And a minimal compilable example showing the issue would also help people help you. -
wrote on 23 Aug 2024, 19:54 last edited by Faust Faust
timer = new QTimer(this); connect(timer, &QTimer::timeout, this, &MainWindow::timeout); timer->setInterval(1000); timer->start(1000);
Qt version 6 7 2 Version ndk 25
-
Try this, please:
QTimer::singleShot(1000, this, [](){ qFatal() << “I crash, when QTimer works”; });
-
Try this, please:
QTimer::singleShot(1000, this, [](){ qFatal() << “I crash, when QTimer works”; });
wrote on 6 Sept 2024, 00:54 last edited by@Axel-Spoerl
F libTimer_test_armeabi-v7a.so: I crash, when QTimer works
F libc : Fatal signal 6 (SIGABRT), code -6 in tid 14794 (qtMainLoopThrea), pid 14747 (mple.Timer_test)
I libc : orig_dumpable: 1 -
Moderatorswrote on 6 Sept 2024, 11:29 last edited by Axel Spoerl 9 Jun 2024, 11:37
Can you be more precise? Have you tried the code and then crashed?
I have the impression that the build is actually broken. -
wrote on 7 Sept 2024, 01:33 last edited by
I tried the code you suggested and it actually crashes.
This is absurd.
Version 5 was great, 6 introduced tons of bugs and slow compilation. -
Moderatorswrote on 7 Sept 2024, 05:41 last edited by Axel Spoerl 9 Jul 2024, 08:18
Mind your language. General negative statements aren’t welcome here, especially if they are bluntly wrong and insulting.
Why do you expect NDK25 to work with Qt 6.7.2?
Have you checked our documentation? You need NDK26.
Have you checked the Qt Creator Settings for Android? I have the impression that you attempt to use a Qt 5 based project in 6.7.2 without updating SDK and NDK. -
wrote on 9 Sept 2024, 09:35 last edited by
I just used NDK26, in a new simple project, but it doesn't change much. timeout is only called when the application focus changes.
-
-
I tried the code you suggested and it actually crashes.
This is absurd.
Version 5 was great, 6 introduced tons of bugs and slow compilation.@Faust-Faust said in QTimer not work:
I tried the code you suggested and it actually crashes
Which proves that the timer is working. This was intended by @Axel-Spoerl , nothing absurd about it.
Please read https://doc.qt.io/qt-5/qtglobal.html#qFatal - qFatal will terminate your app ("If you are using the default message handler this function will abort")