Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set the progressMinimum() and progressMaximum() of QFutureWatcher
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 475 Views
  • 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 Offline
    M Offline
    meganathan
    wrote on last edited by
    #1

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

    jsulmJ JonBJ 2 Replies Last reply
    0
    • M meganathan

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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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
      3
      • M meganathan

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

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @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
        3
        • M Offline
          M Offline
          meganathan
          wrote on last edited by
          #4

          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
          0
          • M meganathan

            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 Offline
            M Offline
            meganathan
            wrote on last edited by
            #5

            @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
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved