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. Updating a progress bar
QtWS25 Last Chance

Updating a progress bar

Scheduled Pinned Locked Moved Unsolved General and Desktop
helpqtcreatorprogress bar
11 Posts 3 Posters 3.2k 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.
  • D Offline
    D Offline
    dani98000
    wrote on 23 Jan 2016, 17:39 last edited by
    #1

    i am trying to do a progress bar from 0% to 100%
    that will get my value from my temp sensor (i called it bufferSplit) and i want that the number 0 will be the minimum and the number 35 will be the maximum(100%)

    This is for a project in my school
    Thank you in advanced for the help =]

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dani98000
      wrote on 23 Jan 2016, 18:29 last edited by
      #2

      Please help!

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 23 Jan 2016, 20:03 last edited by
        #3

        Hi
        Please have slightly more patience before bumping a topic
        as many users here are in other time zones - so give it a day. :)

        QProgressbar has setMaximum() for setting upper limit.

        If that is the actual question ?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dani98000
          wrote on 23 Jan 2016, 20:11 last edited by dani98000
          #4

          @mrjj i mean that the progress bar will show 0 to 100% but the 100% is 35 celsius

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 23 Jan 2016, 20:43 last edited by
            #5

            Hi and welcome to devnet,

            Then use QProgressBar::setRange
            So basically:

            myProgressBar->setRange(0, 35);
            

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            D 1 Reply Last reply 23 Jan 2016, 21:06
            0
            • S SGaist
              23 Jan 2016, 20:43

              Hi and welcome to devnet,

              Then use QProgressBar::setRange
              So basically:

              myProgressBar->setRange(0, 35);
              
              D Offline
              D Offline
              dani98000
              wrote on 23 Jan 2016, 21:06 last edited by
              #6

              @SGaist where does it use the value from the temperature sensor?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 23 Jan 2016, 21:08 last edited by
                #7

                Once you have them, call setValue on the progress bar

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                D 1 Reply Last reply 23 Jan 2016, 21:12
                0
                • S SGaist
                  23 Jan 2016, 21:08

                  Once you have them, call setValue on the progress bar

                  D Offline
                  D Offline
                  dani98000
                  wrote on 23 Jan 2016, 21:12 last edited by dani98000
                  #8

                  @SGaist said:

                  QProgressBar::setRange

                  what do you mean?
                  im sorry for all the questions im new to this
                  the temp for the sensor is called buffersplit
                  so can you please tell me the code that i should do?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 23 Jan 2016, 21:22 last edited by
                    #9

                    I mean that if you know that the temperature is between 0 and 35 then you can already set the minimum and maximum value of the progress bar.

                    What is buffersplit exactly ? A variable containing an integer value ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    D 1 Reply Last reply 23 Jan 2016, 21:25
                    0
                    • S SGaist
                      23 Jan 2016, 21:22

                      I mean that if you know that the temperature is between 0 and 35 then you can already set the minimum and maximum value of the progress bar.

                      What is buffersplit exactly ? A variable containing an integer value ?

                      D Offline
                      D Offline
                      dani98000
                      wrote on 23 Jan 2016, 21:25 last edited by
                      #10

                      @SGaist yes

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 23 Jan 2016, 21:26 last edited by
                        #11

                        Well, when buffersplit call setValue(buffersplit) on your progress bar.

                        I'd recommend using a more descriptive variable name

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0

                        1/11

                        23 Jan 2016, 17:39

                        • Login

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