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. Validating user input and set button to setEnablet(true)

Validating user input and set button to setEnablet(true)

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.0k 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.
  • D Offline
    D Offline
    DarkRoast
    wrote on last edited by
    #1

    Hi all

    My first post here...

    In my app I have 7 spinboxes where 5 of them have to be valid before I can set the pushbutton to setEnablet(true). Is there a Qt way of doing this, or do I have to manage all of the spinboxes and make my own validation when to enable the button ?

    i.e do I have to catch a signal from the sbinboxes and keep track of who has a value etc. ?

    Thanks in advance
    DarkRoast

    1 Reply Last reply
    0
    • I Offline
      I Offline
      ivan.todorovich
      wrote on last edited by
      #2

      I would add a SLOT in your MainWindow, void validate(); or something like that.
      And then connect the valueChanged signal of every spinboxes to that slot, and handle the validation there.

      o_o Sorry for my rusted english.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        That's the only senseful way doing this.

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DarkRoast
          wrote on last edited by
          #4

          Thats what I thought, thank you guys!

          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