Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTimer deads after laptop hibernation
Forum Updated to NodeBB v4.3 + New Features

QTimer deads after laptop hibernation

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 2.7k Views 1 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.
  • U Offline
    U Offline
    unmanner
    wrote on last edited by
    #1

    Hello!

    I use QTimer for polling SOAP server in my application like:

    @pollTimer = new QTimer(this);
    connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollServer()));
    pollTimer->start(pollTimeout);@

    After sometimes(1-2 days or laptop gibernation) timer stops working and client application is unable to poll server..

    How to solve this problem?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      what means

      bq. After sometimes(1-2 days or laptop gibernation) timer stops working

      ?

      If you call QTimer::isActive(), what is the result?
      if you call QTimer::remainingTime(), what is the result?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • U Offline
        U Offline
        unmanner
        wrote on last edited by
        #3

        Hi,

        thank you for reply.

        My problem is the following - the QTimer stops working after my laptop hasn't been used for a while. (Hibernation or sleep is generaly suspected)

        Result of QTimer::isActive() - true.
        I'll check the resut of QTimer::remainingTime() asap and come back with result.

        1 Reply Last reply
        0
        • U Offline
          U Offline
          unmanner
          wrote on last edited by
          #4

          Hello!

          resut of QTimer::remainingTime() is "0".

          Problem was reproduced after application was running about 3 days.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            amahta
            wrote on last edited by
            #5

            Take a look at "this":http://qt-project.org/doc/qt-5.0/qtcore/qtimer.html#remainingTime-prop ,

            Your timer must have went overdue while your computer was off or something. I suggest you should use a thread.

            Thou shalt programme
            http://www.amin-ahmadi.com

            1 Reply Last reply
            0
            • A Offline
              A Offline
              amahta
              wrote on last edited by
              #6

              Or maybe "this":http://qt-project.org/doc/qt-5.0/qtcore/qtimer.html#singleShot-prop will help you without changing to threads.

              Thou shalt programme
              http://www.amin-ahmadi.com

              1 Reply Last reply
              0
              • U Offline
                U Offline
                unmanner
                wrote on last edited by
                #7

                Yes, but in not a single shot and timer slot should be called after each expiration.

                If you sure in your doubt please propose a simple solution.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  amahta
                  wrote on last edited by
                  #8

                  Oh, so you have set it to non-single-shot. I'm not sure if this will help you but you can try an activation signal received by your application, and connect it to an slot which checks your timer to see if it's overdue or not.

                  Thou shalt programme
                  http://www.amin-ahmadi.com

                  1 Reply Last reply
                  0
                  • U Offline
                    U Offline
                    unmanner
                    wrote on last edited by
                    #9

                    I try to write a simple application, and return with results.

                    1 Reply Last reply
                    0

                    • Login

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