Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDoubleSpinBox -- how to tell if signal is from spin box or field
Forum Updated to NodeBB v4.3 + New Features

QDoubleSpinBox -- how to tell if signal is from spin box or field

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kloveridge
    wrote on last edited by
    #1

    The QDoubleSpinBox is very close to what I basically need, with one notible issue.

    When handling the slots and signals I want this behavior:

    1. If I edit the text I want the signal after I hit enter.
    2. If I edit the spinner, I want the signal
    3. As I type in the text I DONT want a signal. I just want the signal after the user hits the enter key.

    The trouble this causes is with my Undo implementation. If I'm in the middle of typing a number in the field, I don't want store off a undo for every character! Is there a way to tell which control called the valueChange() ?

    1 Reply Last reply
    0
    • TheBadgerT Offline
      TheBadgerT Offline
      TheBadger
      wrote on last edited by
      #2

      Hi,

      Not sure how to tell, but check what happens if you connect to the "void editingFinished()" signal. That might give you what you need


      Check out my SpellChecker Plugin for Qt Creator @ https://github.com/CJCombrink/SpellChecker-Plugin

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kloveridge
        wrote on last edited by
        #3

        The editingFinished() is perfect when editing the text field. Its the valueChanged() signal I wish I could get more information about.

        The trouble with valueChanged() is basically this:

        1. The transaction of editing the text field really should "count" until either the user hits enter or the widget loses focus.

        2. But if I modify the spinner, its a completed transaction every time I hit the button.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved