Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    [Solved] QSpinBox: how to signal only when editing finished?

    General and Desktop
    2
    3
    11579
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      calberto last edited by

      QSpinBox normally emit signal valueChanged(int) for each key stroke, so if I want to insert "123", I receive 3 signals for 1, 12 and 123. I need to known when the user has completed the input, so to receive only one signal for the complete number 123.

      I known I can connect to the signal editingFinisched(), but this only partially resolve my problem since I also want to be signaled even when the user step up/down (this is considered a "complete" input) and if I setValue() programmaticly.

      How can I do that?

      1 Reply Last reply Reply Quote 0
      • T
        tony last edited by

        Hi,

        just switch off "keyboardTracking":http://doc.qt.nokia.com/4.7/qabstractspinbox.html#keyboardTracking-prop

        Tony.

        1 Reply Last reply Reply Quote 0
        • C
          calberto last edited by

          Thanks, it is exactly what I need. And sorry, it could be found in the documentation but I really miss the point while looking for a solution (too much concentrated on signals and slots)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post