[Lazarus] Order of OnCreate and OnActivate in Qt4

Vojtěch Čihák vojtech.cihak at atlas.cz
Sun Nov 25 16:43:53 CET 2018


Hi,
 
I met strange bug today. I have these lines in .lpr:
...
Application.CreateForm(TFrmMain, FrmMain);
...
Application.CreateForm(TFrmContext, FrmContext);
...
 
and the order of events in Qt and GTk2 is:
FrmMain.Create
FrmContext.Create
FrmMain.Activate
 
Today I used tool qtconfig and changed style (Appearance) from Plastique to QtCurve. Now my code crashes, order of events is:
FrmMain.Create
FrmMain.Activate
CRASH, because code in OnActivate assumes that FrmContext already exists.
 
So, Qt4+Plastique has different order of events than Qt4+QtCurve.
Unfortunately, I cannot reproduce with simple demo.
 
What I'm doing wrong? Do I rely on something that is not guaranteed?
 
Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181125/1c38ab93/attachment.html>


More information about the Lazarus mailing list