PDA

View Full Version : Modifying a QWizard



anotherguy
26th October 2015, 14:54
Hello all

I have an issue where I am tasked to modify an existing QWizard application.

Bascially there was a wizard with 6 pages. I wanted to remove the last 3.

There is a main QWizard class where there are pages variables being declared in the constructor, which I didn't remove because many methods depend on those variabls

However, there is also an addPage method being called in the constructor which takes each page variable.
I removed the addPaeg call for the pages I didn't want.

I also went to the 3rd page class, and added an isComplete method, a setComplete method, and removed the nextId method.

Now when I run the wizard, I only see 3 pages. However, the third page does not have a finish button.

I can't figure out why.

anda_skoa
26th October 2015, 16:03
Does your setComplete() method emit the completeChanged() signal?

Cheers,
_

anotherguy
26th October 2015, 19:58
Yes it does.

I feel that the pages are not being removed even though i got rid of the addPage calls.
Considering the page says next still.

ChrisW67
26th October 2015, 20:03
The nextId() function you removed needs to exist and return -1 if the wizard thinks there is a next page (which it may do at the moment)

anotherguy
26th October 2015, 20:41
Thanks, that took me to the last page. Although the finish button isn't functional.

It seems like some pages I skip are doing backend functionality stuff, so I need another workaround.

Is there a way to "fake" a wizard page where you do not show it, but you still do all the processing that it would do upon clicking next?

So I'd originally have pg 1,2,3,4,5,6 where 1 is the beginning and 6 is the end.

1,2 are shown and upon clicking next, it just executes 4,5 too without showing it. Then just 6 shows and you click finish.