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

QDial - loops

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

    Hello, I made a Program with just a basic QDial and a progressBar, I have included some code below. I'm just having a hard time with the loops, if that's what I should do? I have 0 as default, and 100 as maximum.. Thanks, =).

    @
    connect(ui->dial, SIGNAL(sliderMoved(int)), ui->progressBar, SLOT(update()));

    // Should I add a separate update function? Program1::update()
    {
    // Very confused here, the person who has been helping me hasn't been around, =/.
    }
    for (i-0; i<=100; i++); // Not sure if I should use i<100 or i<=100;
    {
    // This is where I'm stuck at..
    }
    @

    Edit: replaced code tags for @ tags, as they work better in the forum section; Andre

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Hi Richard,

      if you want the value of the dial in the progress bar, you need another connect statement:

      @
      connect(ui->dial, SIGNAL(sliderMoved(int)), ui->progressBar, SLOT(setValue(int)));
      @

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mlong
        wrote on last edited by
        #3

        What exactly are you wanting to do in the loop?

        Software Engineer
        My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

        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