Results 1 to 5 of 5

Thread: QSpinBox Timer Issue

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSpinBox Timer Issue

    Hi,

    I have an application that executes a calculation on QSpinBox::valueChanged.
    This calculation takes around half a second to perform.

    When a user clicks the step up button, two valueChanged events occur.

    After some digging, this appears to be because the calculation takes a bit too long, causing the timer to fire. When valueChanged and the calc finishes, the spinbox receives a timerEvent followed by a mouseReleaseEvent.

    Since the user did a simple click, so releasing the the mouse before the timer was due to fire, I see this as a qt bug. Surely qt should send events in chronological order, ie. mouseReleaseEvent followed by timerEvent.

    Thanks
    Bruce

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSpinBox Timer Issue

    for long time calculation I suggest you to use QRunnable.

    For me (Qt 4.7.3) the slot is called once. Are you sure you don't connected twice?
    A camel can go 14 days without drink,
    I can't!!!

Similar Threads

  1. timer problem(timer does not work)
    By masuk in forum Newbie
    Replies: 6
    Last Post: 14th February 2011, 05:00
  2. How to add timer delay
    By qtUse in forum Newbie
    Replies: 1
    Last Post: 12th October 2010, 18:09
  3. Timer for application
    By Zergi in forum Qt Programming
    Replies: 3
    Last Post: 26th December 2007, 22:21
  4. Timer call
    By mahe2310 in forum Qt Programming
    Replies: 1
    Last Post: 28th March 2006, 08:57
  5. Timer not timing out?
    By Mariane in forum Newbie
    Replies: 5
    Last Post: 2nd March 2006, 21:30

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.