0

I need to create a ProgressBar with a gradation of 0.00 to 1.00. I think it is possible to overload the function Value () and setMaximum (), setMinimum ().

Or is it better to draw this element anew in open_gl ???

timob256
  • 148
  • 2
  • 15
  • Have a look at https://stackoverflow.com/questions/19003369/how-to-make-a-qslider-change-with-double-values – JLev Apr 25 '18 at 06:47
  • 3
    You can maybe multiply your values by 100 and use `setFormat(const QString &format)` to display `1.00` when you have `100` – Rafalon Apr 25 '18 at 06:49
  • Possible duplicate of [How to make a QSlider change with double values](https://stackoverflow.com/questions/19003369/how-to-make-a-qslider-change-with-double-values) – vahancho Apr 25 '18 at 09:15

1 Answers1

0
 void MainWindow::on_pB_DD1_valueChanged(int value)
 {
      double i = value/100.0;
      ui->pB_DD1->setFormat(QString::number(i)+trUtf8("МПа"));
 }

@Rafalon Thank you

timob256
  • 148
  • 2
  • 15