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

Updating a progress bar

Scheduled Pinned Locked Moved Unsolved General and Desktop
helpqtcreatorprogress bar
11 Posts 3 Posters 3.2k Views 2 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
    dani98000
    wrote on 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 last edited by
      #2

      Please help!

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on 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 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
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on 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
            0
            • SGaistS SGaist

              Hi and welcome to devnet,

              Then use QProgressBar::setRange
              So basically:

              myProgressBar->setRange(0, 35);
              
              D Offline
              D Offline
              dani98000
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on 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
                0
                • SGaistS SGaist

                  Once you have them, call setValue on the progress bar

                  D Offline
                  D Offline
                  dani98000
                  wrote on 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
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 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
                    0
                    • SGaistS SGaist

                      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 last edited by
                      #10

                      @SGaist yes

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 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

                        • Login

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