Results 1 to 6 of 6

Thread: Problem about QTimer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    9
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Problem about QTimer

    I have several classes in my program, one of them is the main GUI and other is an XML-RPC (from XML-RPC for C/C++) class that have several methods. All thinks goes ok, but when I start the QTimer in the GUI class from the XMLRPC clas it says "QTimer can't be stop/started from other thread". If I put signals and slots does nothing. WTF?

    Qt Code:
    1. cambiaTimer::cambiaTimer ( rssani_lite *rss, QObject *parent ) : QObject ( parent ),rpc_ani ( rss ) {
    2. connect ( this,SIGNAL ( cambiarTimer ( int ) ), rss, SLOT ( cambiaTimer ( int ) ) );
    3. }
    4.  
    5. void cambiaTimer::execute ( xmlrpc_c::paramList const& paramList,xmlrpc_c::value * const retvalP ) {
    6.  
    7. emit cambiarTimer ( 1 );
    8. std::cerr << "RPC llamada" << std::endl;
    9. *retvalP = xmlrpc_c::value_int ( 0 ) ;
    10. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. void rssani_lite::cambiaTimer(int tiempo) {
    2. qDebug() << "Timer cambiado a : " << tiempo << endl;
    3. this->tiempo = tiempo;
    4. timer.start ( tiempo * 60 * 1000 );
    5. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. class rssani_lite : public QObject {
    2. Q_OBJECT
    3.  
    4. public:
    5. rssani_lite ( QObject* parent = 0);
    6. ~rssani_lite();
    7.  
    8. public slots:
    9. void cambiaTimer(int tiempo);
    10. ....
    11. }
    To copy to clipboard, switch view to plain text mode 

    Thanks in advance.
    Last edited by pawer; 21st January 2008 at 19:29.

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.