Results 1 to 3 of 3

Thread: Avoiding system signals

  1. #1
    Join Date
    Aug 2007
    Posts
    64
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Avoiding system signals

    I have a connection in a QSpinBox, but I need differentiate who emitted the signal, user or code, how can I do it??

    The signal is valueChanged.

  2. #2
    Join Date
    Jan 2006
    Location
    Boston, MA
    Posts
    40
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Avoiding system signals

    Not really sure why you will need it, but the only way I see is to track of mouse/keyboard events for same SpinBox as well. So if valueChanged() emitted - check for previous mousePressEvent()/KeyboardPressEvent()/keyboardReleaseEvent() for that spinbox in your custom list of events, then clear that list for next iteration.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Avoiding system signals

    You can block signals temporarily meanwhile setting the value in code:
    Qt Code:
    1. spinBox->blockSignals(true);
    2. spinBox->setValue(...);
    3. spinBox->blockSignals(false);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. System environment variable
    By fahlen in forum Qt Programming
    Replies: 4
    Last Post: 27th November 2007, 19:02
  2. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15

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.