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. Dial constant update
Forum Update on Monday, May 27th 2025

Dial constant update

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.5k Views
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi, complete beginner here.
    In my project I have a dial and a text object. Basically I want the text box to update and display the value of the dial when the dial is used. The code i have works, to a certain extent, however the the text box only updates AFTER the dial stops moving. I want it to give constant feedback to the user on what value they are selecting.

    So i am using:

    dial1.onValueChanged : {
               text1.text = dial1.value;
    }
    

    My question is which implementation of dial1 will constantly update the text1 with the value WHILE the dial is moved?

    Thanks very much

    RatzzR 1 Reply Last reply
    0
    • ? A Former User

      Hi, complete beginner here.
      In my project I have a dial and a text object. Basically I want the text box to update and display the value of the dial when the dial is used. The code i have works, to a certain extent, however the the text box only updates AFTER the dial stops moving. I want it to give constant feedback to the user on what value they are selecting.

      So i am using:

      dial1.onValueChanged : {
                 text1.text = dial1.value;
      }
      

      My question is which implementation of dial1 will constantly update the text1 with the value WHILE the dial is moved?

      Thanks very much

      RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by
      #2

      @amygdata
      Have you tried with http://doc.qt.io/qt-4.8/qabstractslider.html#sliderPosition-prop ?

      --Alles ist gut.

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Thanks - would you mind giving me some example code to add to what I have already? I am really just starting out. Really appreciate it.

        RatzzR 1 Reply Last reply
        0
        • ? A Former User

          Thanks - would you mind giving me some example code to add to what I have already? I am really just starting out. Really appreciate it.

          RatzzR Offline
          RatzzR Offline
          Ratzz
          wrote on last edited by
          #4

          @amygdata
          when the sliderMoved() signal is emitted you make a slot to to hold the position of dial on to the text box.

          --Alles ist gut.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Sorry , i'm confused - how do I link the slider to the Dial? The dial doesn't have a slidermoved property?

            RatzzR 1 Reply Last reply
            0
            • ? A Former User

              Sorry , i'm confused - how do I link the slider to the Dial? The dial doesn't have a slidermoved property?

              RatzzR Offline
              RatzzR Offline
              Ratzz
              wrote on last edited by
              #6

              @amygdata
              I Do not know QML .

              I did this way works for me .

              connect(ui->dial,SIGNAL(sliderMoved(int)),this,SLOT(sliderValueChanged(int)));
              
              void MyClass::sliderValueChanged(int position)
              {
                  ui->lineEdit->setText(QString::number(position));
              }

              --Alles ist gut.

              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