Results 1 to 6 of 6

Thread: Problem about QTimer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem about QTimer

    Maybe one of these two classes:
    Qt Code:
    1. rssani_lite *rss = new rssani_lite();
    2. new rssxmlrpc(rss);
    To copy to clipboard, switch view to plain text mode 
    starts a new thread? The effect you observe suggests rssani_lite is the one. The timer object is a member of the rssani_lite class but it does not live in the thread spawned by that class.

  2. The following user says thank you to wysota for this useful post:

    pawer (22nd January 2008)

  3. #2
    Join Date
    May 2007
    Posts
    9
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem about QTimer

    Qt Code:
    1. $ ./rssani_lite
    2. RPC llamada
    3. Timer cambiado a : 1
    4.  
    5. QObject::killTimer: timers cannot be stopped from another thread
    6. QObject::startTimer: timers cannot be started from another thread
    7. QObject::killTimer: timers cannot be stopped from another thread
    8. QObject::startTimer: timers cannot be started from another thread
    To copy to clipboard, switch view to plain text mode 

    This is the output if I call the method directly. I don't know the signal behaviour, because the slot is not called.

    Thanks for your answers.
    Last edited by pawer; 22nd January 2008 at 17:39.

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem about QTimer

    Signals and slots have nothing to do with it. You just have to start the timer from within the proper thread.

Similar Threads

  1. QTimer and QSqlDatabase Problem
    By smtgra011 in forum Qt Programming
    Replies: 6
    Last Post: 4th July 2007, 16:37
  2. QTimer problem
    By vv in forum Qt Programming
    Replies: 9
    Last Post: 3rd July 2007, 08:13
  3. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  4. Qthread n QTimer Problem
    By quickNitin in forum Qt Programming
    Replies: 5
    Last Post: 8th June 2006, 14:12
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.