PDA

View Full Version : Carry out processing as soon as a QWizardPage is visible?



firedragon
18th June 2012, 13:20
I have a series of QWizardPages set up to ask a user for a set of information. Once completed there is a final page with a Commit. Once the Commit is pressed I want to display a series of test steps to the user within the wizard page and then allow Finish to be pressed. Given the steps needed are very linear it seemed that this was an appropriate way to do it.

However when Commit is pressed I cannot find the function/signal that shows a page is displayed. showEvent() and initializePage() both seem to be called before the page is displayed to the user.

How can I determine that the page is displayed so that I can carry out the processing?

ChrisW67
19th June 2012, 01:37
You want them to press Commit and display a series of pages to them in a linear fashion. Seems that you simply want to put the pages into the QWizard, with the final page carrying a Finish button.

firedragon
19th June 2012, 10:31
What I want is that on page 4, say, is that it says on the wizardpage something like. All test settings chosen, press commit to run test. It then goes to the next page and runs the tests, displaying progress as it goes until the test is complete at which point the Finish button (or next) is then available to be pressed.

However when I switch to the new page the functions I mentioned happen before the page is shown. Perhaps I am looking at doing it in the wrong way or place within the wizard?

ReshmaRatan
21st May 2018, 09:29
What I want is that on page 4, say, is that it says on the wizardpage something like. All test settings chosen, press commit to run test. It then goes to the next page and runs the tests, displaying progress as it goes until the test is complete at which point the Finish button (or next) is then available to be pressed.

However when I switch to the new page the functions I mentioned happen before the page is shown. Perhaps I am looking at doing it in the wrong way or place within the wizard?

Hello Everyone,

Does anyone have solution for this problem. Please reply.

ReshmaRatan
21st May 2018, 12:39
Hi All,

I found a solution for this problem.

We have to overwrite the showevent of QWizardPage and then use QTimer::singleshot.
Below is the sample code.

void CSampleWizardPage::showEvent(QShowEvent *event)
{
QWizardPage::showEvent(event);
QTimer::singleShot(50, this, SLOT(startRequest()));
return;
}

Please let me know if this solution is useful to you...