How to set the progressMinimum() and progressMaximum() of QFutureWatcher
-
Hi,
I need to start the progress dialog from 15% percentage. I don't see any like set progressMinimum() or progressMaximum in Qt documentation.
Constructor:
dialog = new QProgressDialog();
dialog->setWindowTitle("Test");
dialog->setMaximumSize(325,85);
dialog->setMinimumSize(325,85);
connect(watcher, SIGNAL(finished()), this, SLOT(FinishedFormat()));
connect(watcher, SIGNAL(progressRangeChanged(int,int)), dialog, SLOT(setRange(int,int)));
connect(watcher, SIGNAL(progressValueChanged(int)), dialog, SLOT(setValue(int)));inside func:
for(int i=0;i<5;i++)
{
vec->append(i);
}watcher->setFuture(QtConcurrent::map(*vec,&QthreadTest::felix2Solver));
Display the dialog and start the event loop.
dialog->exec();
watcher->waitForFinished(); -
Hi,
I need to start the progress dialog from 15% percentage. I don't see any like set progressMinimum() or progressMaximum in Qt documentation.
Constructor:
dialog = new QProgressDialog();
dialog->setWindowTitle("Test");
dialog->setMaximumSize(325,85);
dialog->setMinimumSize(325,85);
connect(watcher, SIGNAL(finished()), this, SLOT(FinishedFormat()));
connect(watcher, SIGNAL(progressRangeChanged(int,int)), dialog, SLOT(setRange(int,int)));
connect(watcher, SIGNAL(progressValueChanged(int)), dialog, SLOT(setValue(int)));inside func:
for(int i=0;i<5;i++)
{
vec->append(i);
}watcher->setFuture(QtConcurrent::map(*vec,&QthreadTest::felix2Solver));
Display the dialog and start the event loop.
dialog->exec();
watcher->waitForFinished(); -
Hi,
I need to start the progress dialog from 15% percentage. I don't see any like set progressMinimum() or progressMaximum in Qt documentation.
Constructor:
dialog = new QProgressDialog();
dialog->setWindowTitle("Test");
dialog->setMaximumSize(325,85);
dialog->setMinimumSize(325,85);
connect(watcher, SIGNAL(finished()), this, SLOT(FinishedFormat()));
connect(watcher, SIGNAL(progressRangeChanged(int,int)), dialog, SLOT(setRange(int,int)));
connect(watcher, SIGNAL(progressValueChanged(int)), dialog, SLOT(setValue(int)));inside func:
for(int i=0;i<5;i++)
{
vec->append(i);
}watcher->setFuture(QtConcurrent::map(*vec,&QthreadTest::felix2Solver));
Display the dialog and start the event loop.
dialog->exec();
watcher->waitForFinished();@meganathan
Unless I misunderstand, your topic title is confusing. You wish to set the progress values in aQProgressDialog, right? So it has nothing to do with theQFutureWatcheryou happen to be utilising?So what about all the methods in https://doc.qt.io/qt-5/qprogressdialog.html :
setMinimum/Maximum/Range/Value()? -
Even after setting the dialog->setMinimum() and setMaximum() and removing the connect(watcher, SIGNAL(progressRangeChanged(int,int)), dialog, SLOT(setRange(int,int))); the progressValueChanged is not emitting
-
Even after setting the dialog->setMinimum() and setMaximum() and removing the connect(watcher, SIGNAL(progressRangeChanged(int,int)), dialog, SLOT(setRange(int,int))); the progressValueChanged is not emitting
@meganathan said in How to set the progressMinimum() and progressMaximum() of QFutureWatcher:
Even after setting the dialog->setMinimum() and setMaximum() and removing the connect(watcher, SIGNAL(progressRangeChanged(int,int)), dialog, SLOT(setRange(int,int))); the progressValueChanged is not emitting
on using progressRangeChanged it resets the Qprogress range to (0,0). That is the reason i am trying to set the progressMinimum() and progressMaximum().