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:
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(this->ui->test_button, SIGNAL(clicked()), SLOT(call_algorithm()));
}
void MainWindow::call_algorithm()
{
QFuture<void> future = QtConcurrent::run(algorithm, this->ui->jpg_name_edit->text());
}
{
//some code here =)
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(this->ui->test_button, SIGNAL(clicked()), SLOT(call_algorithm()));
}
void MainWindow::call_algorithm()
{
QFuture<void> future = QtConcurrent::run(algorithm, this->ui->jpg_name_edit->text());
}
void algorithm(QString image_name)
{
//some code here =)
}
To copy to clipboard, switch view to plain text mode
Bookmarks