Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, April 2008
QWizardPage executing function after initializePage() is called and WizardPage is shown


Message 1 in thread

Hello !

I have a simple question:

I have a wizard with some QWizardPages.

At the last Page, I want that a progressbar is shown and executing a 
task (function).

The pages are created at the ctor of QWizard and the progressbar is 
created in QWizardPage::initializePage().

The problem is, that if I start the task (function) in initializePage(), 
the wizardpage is shown after the task is finished.

But I want that the wizardpage is shown and than start the task, how can 
I make this work easy ?

Thanks a lot for helping !

Heiko

-- 
 [ signature omitted ] 
begin:vcard
fn:Heiko Steindl
n:Steindl;Heiko
org:Computerhaus EDV-Handels Ges.m.b.H;Internet
adr;quoted-printable:;;Wienerstrasse 35a;Kapfenberg;Steiermark;8605;=C3=96sterreich
email;internet:heiko@xxxxxx
tel;work:+43 (0)3862 27777
tel;fax:+43 (0)3862 27777 77
tel;cell:+43 (0)676 3727777
x-mozilla-html:TRUE
url:http://www.kom.at
version:2.1
end:vcard


Message 2 in thread

I'm not sure if this helps, but judging from my experiences, this sort of 
problems can be fixed by starting the function a bit later (at the end of the 
current event queue), giving Qt time to show() the widget. This can be done 
with something like

QTimer::singleShot(0, your_object, SLOT(your_function())

in the initializePage() routine.

To correctly update the progress bar, you should also call 
qApp->processEvents() every now and then within this function...

HTH, RenÃ

On Tue April 29 2008 15:35, Heiko Steindl wrote:
> I have a simple question:
>
> I have a wizard with some QWizardPages.
>
> At the last Page, I want that a progressbar is shown and executing a
> task (function).
>
> The pages are created at the ctor of QWizard and the progressbar is
> created in QWizardPage::initializePage().
>
> The problem is, that if I start the task (function) in initializePage(),
> the wizardpage is shown after the task is finished.
>
> But I want that the wizardpage is shown and than start the task, how can
> I make this work easy ?
>
> Thanks a lot for helping !
>
> Heiko

-- 
 [ signature omitted ] 

Message 3 in thread

Hi Rene !

thanks a lot, now it works as suspected ;-)

Best regards

Heiko

R. Reucher schrieb:
> I'm not sure if this helps, but judging from my experiences, this sort of 
> problems can be fixed by starting the function a bit later (at the end of the 
> current event queue), giving Qt time to show() the widget. This can be done 
> with something like
>
> QTimer::singleShot(0, your_object, SLOT(your_function())
>
> in the initializePage() routine.
>
> To correctly update the progress bar, you should also call 
> qApp->processEvents() every now and then within this function...
>
> HTH, RenÃ
>
> On Tue April 29 2008 15:35, Heiko Steindl wrote:
>   
>> I have a simple question:
>>
>> I have a wizard with some QWizardPages.
>>
>> At the last Page, I want that a progressbar is shown and executing a
>> task (function).
>>
>> The pages are created at the ctor of QWizard and the progressbar is
>> created in QWizardPage::initializePage().
>>
>> The problem is, that if I start the task (function) in initializePage(),
>> the wizardpage is shown after the task is finished.
>>
>> But I want that the wizardpage is shown and than start the task, how can
>> I make this work easy ?
>>
>> Thanks a lot for helping !
>>
>> Heiko
>>     
>
>   

-- 
 [ signature omitted ] 
begin:vcard
fn:Heiko Steindl
n:Steindl;Heiko
org:Computerhaus EDV-Handels Ges.m.b.H;Internet
adr;quoted-printable:;;Wienerstrasse 35a;Kapfenberg;Steiermark;8605;=C3=96sterreich
email;internet:heiko@xxxxxx
tel;work:+43 (0)3862 27777
tel;fax:+43 (0)3862 27777 77
tel;cell:+43 (0)676 3727777
x-mozilla-html:TRUE
url:http://www.kom.at
version:2.1
end:vcard