Hi there. I have got a question for you, guys, which I really would like you to help me with.
I have got a function with QString parameter and within the function long-time procedures take place. I execute this function with QFuture but I would like for the progress of operation to be indicated. For example I can declare the variable inside the function and which varies between 0 and 100. How can I arrange it and bind to QProgressDialog? Here goes the snippet:

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6. connect(this->ui->test_button, SIGNAL(clicked()), SLOT(call_algorithm()));
  7. }
  8.  
  9. void MainWindow::call_algorithm()
  10. {
  11. QFuture<void> future = QtConcurrent::run(algorithm, this->ui->jpg_name_edit->text());
  12. }
  13.  
  14. void algorithm(QString image_name)
  15. {
  16. //some code here =)
  17. }
To copy to clipboard, switch view to plain text mode