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. Using the value of a double spin box
Forum Updated to NodeBB v4.3 + New Features

Using the value of a double spin box

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 6.4k 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.
  • J Offline
    J Offline
    jk_mk
    wrote on last edited by
    #1

    Hello to all,

    I am using a doubleSpinBox in Qt designer. I want to get the value of this doubleSpinBox and use it directly in my code.How could this be done? Do I just need to use something like this?

    @ ui->doubleSpinBox->value();@

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Signal-slot?

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jk_mk
        wrote on last edited by
        #3

        I do not want to use the value of doubleSpinBox every time the value is changed.I am using Qt designer and I just want to set the value, and then insert ths value in my code as a variable. Do I really need to use signal-slot? Could you be more specific?

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vcsala
          wrote on last edited by
          #4

          [quote author="jk_mk" date="1307257128"]ui->doubleSpinBox->value();[/quote]

          QDoubleSpinBox has a value method, so you should be able to use it. So what is your problem? Have you tried the quoted code? Do you have issue with the protected/private inheritance?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jk_mk
            wrote on last edited by
            #5

            Well, I have found my mistake. I am beginner in using Qt and I am not used in using signal and slots.So I am a little confused.But in my application, I give this signal and slot by pressing a button.As a result I am using this code and get the results every time I press this button.
            @
            ui->doubleSpinBox->value();@

            Thanks for your replies

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vcsala
              wrote on last edited by
              #6

              Your welcome. If you consider your issue solved please set the thread so.

              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