Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to set the progressMinimum() and progressMaximum() of QFutureWatcher

    General and Desktop
    3
    5
    164
    Loading More Posts
    • 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.
    • M
      meganathan last edited by

      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();

      jsulm JonB 2 Replies Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @meganathan last edited by

        @meganathan https://doc.qt.io/qt-5/qprogressdialog.html#maximum-prop
        https://doc.qt.io/qt-5/qprogressdialog.html#minimum-prop

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 3
        • JonB
          JonB @meganathan last edited by

          @meganathan
          Unless I misunderstand, your topic title is confusing. You wish to set the progress values in a QProgressDialog, right? So it has nothing to do with the QFutureWatcher you happen to be utilising?

          So what about all the methods in https://doc.qt.io/qt-5/qprogressdialog.html : setMinimum/Maximum/Range/Value()?

          1 Reply Last reply Reply Quote 3
          • M
            meganathan last edited by

            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

            M 1 Reply Last reply Reply Quote 0
            • M
              meganathan @meganathan last edited by

              @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().

              1 Reply Last reply Reply Quote 0
              • First post
                Last post