Results 1 to 12 of 12

Thread: Timer delay

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Unhappy Timer delay

    I am trying to implement a GUI having some push buttons & a window to display image.
    There are two buttons Start & Stop
    When the start button is pushed, a sequence of images stored in an array of QString has to be displayed.
    When Start button is pushed, new_dialog() Slot is called.
    The code for new_dialog() is as follows:
    Qt Code:
    1. void Custom_window::new_dialog()
    2. {
    3. list[0] = "/home/suresh/Desktop/Test/gui_client/newflower.png";
    4. list[1] = "/home/suresh/Desktop/Test/gui_client/mod_xfce-in-the-moon.png";
    5. list[2] = "/home/suresh/Examples/logo-Kubuntu.png";
    6. list[3] = "/usr/share/xfce4/backdrops/xfce-smoke.png";
    7. list[4] = "/usr/share/xfce4/backdrops/xubuntu-steel.png";
    8.  
    9. for(int i=0;i<5;++i)
    10. {
    11. QTimer *timer = new QTimer;
    12. QPixmap p(list[i]);
    13. p= p.scaled( old_window->width(), old_window->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    14. old_window->resize(500,480);
    15. old_window->setPixmap(p);
    16. timer->start(5000);
    17. connect(timer, SIGNAL(timeout()),old_window , SLOT(setPixmap(p)));
    18. }
    19.  
    20. }
    To copy to clipboard, switch view to plain text mode 


    The problem I was facing is that I was able to display only the last frame.
    And the error I am facing is
    Object::connect: No such slot QLabel::setPixmap(p)
    But I was able to see the last image.
    Last edited by jpn; 29th May 2008 at 10:51. Reason: missing [code] tags

Similar Threads

  1. Thread, Timer and Socket. Comuication problem
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 17th January 2008, 16:48
  2. Timer for application
    By Zergi in forum Qt Programming
    Replies: 3
    Last Post: 26th December 2007, 22:21
  3. Thread(s) and socket, timer slots
    By stephdev1965 in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2006, 14:04
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. Timer call
    By mahe2310 in forum Qt Programming
    Replies: 1
    Last Post: 28th March 2006, 08: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.