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 Updated to NodeBB v4.3 + New Features

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 5 Jul 2016, 06:48 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

    R 1 Reply Last reply 5 Jul 2016, 07:43
    0
    • ? A Former User
      5 Jul 2016, 06:48

      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

      R Offline
      R Offline
      Ratzz
      wrote on 5 Jul 2016, 07:43 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 5 Jul 2016, 09:39 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.

        R 1 Reply Last reply 5 Jul 2016, 09:59
        0
        • ? A Former User
          5 Jul 2016, 09:39

          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.

          R Offline
          R Offline
          Ratzz
          wrote on 5 Jul 2016, 09:59 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 7 Jul 2016, 06:32 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?

            R 1 Reply Last reply 7 Jul 2016, 07:31
            0
            • ? A Former User
              7 Jul 2016, 06:32

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

              R Offline
              R Offline
              Ratzz
              wrote on 7 Jul 2016, 07:31 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

              3/6

              5 Jul 2016, 09:39

              • Login

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