Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QTimer not work
Forum Updated to NodeBB v4.3 + New Features

QTimer not work

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
11 Posts 4 Posters 913 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    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.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Faust Faust
      wrote on last edited by Faust Faust
      #3
      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

      1 Reply Last reply
      0
      • Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote on last edited by Axel Spoerl
        #4

        Try this, please:

        QTimer::singleShot(1000, this, [](){ qFatal() << “I crash, when QTimer works”; });
        

        Software Engineer
        The Qt Company, Oslo

        F 1 Reply Last reply
        0
        • Axel SpoerlA Axel Spoerl

          Try this, please:

          QTimer::singleShot(1000, this, [](){ qFatal() << “I crash, when QTimer works”; });
          
          F Offline
          F Offline
          Faust Faust
          wrote on last edited by
          #5

          @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

          1 Reply Last reply
          0
          • Axel SpoerlA Offline
            Axel SpoerlA Offline
            Axel Spoerl
            Moderators
            wrote on last edited by Axel Spoerl
            #6

            Can you be more precise? Have you tried the code and then crashed?
            I have the impression that the build is actually broken.

            Software Engineer
            The Qt Company, Oslo

            1 Reply Last reply
            0
            • F Offline
              F Offline
              Faust Faust
              wrote on last edited by
              #7

              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.

              jsulmJ 1 Reply Last reply
              0
              • Axel SpoerlA Offline
                Axel SpoerlA Offline
                Axel Spoerl
                Moderators
                wrote on last edited by Axel Spoerl
                #8

                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.

                Software Engineer
                The Qt Company, Oslo

                1 Reply Last reply
                3
                • F Offline
                  F Offline
                  Faust Faust
                  wrote on last edited by
                  #9

                  I just used NDK26, in a new simple project, but it doesn't change much. timeout is only called when the application focus changes.

                  1 Reply Last reply
                  0
                  • Axel SpoerlA Offline
                    Axel SpoerlA Offline
                    Axel Spoerl
                    Moderators
                    wrote on last edited by
                    #10

                    The lambda code block I posted here, crashes when QTimerworks.
                    The output you posted here confirms that.
                    => The problem is in MainWindiw::timeout(), not in QTimer or elsewhere in Qt.
                    => Since you haven't posted this method, nobody can help you.

                    Software Engineer
                    The Qt Company, Oslo

                    1 Reply Last reply
                    1
                    • F Faust Faust

                      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.

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      @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")

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      2

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved