QTimer not work
-
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. -
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”; });
-
@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 -
Can you be more precise? Have you tried the code and then crashed?
I have the impression that the build is actually broken. -
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. -
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. -
I just used NDK26, in a new simple project, but it doesn't change much. timeout is only called when the application focus changes.
-
-
@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")