Sparta form designer endless loop on when opening forms with Qt widgetset
Original Reporter info from Mantis: sysrpl
-
Reporter name: Anthony Walter
Original Reporter info from Mantis: sysrpl
- Reporter name: Anthony Walter
Description:
There is an issue with the new sparta form designer and Qt where opening an existing project with forms causes and endless loop and crash, possibly even preventing access to other ttys.
I've isolated the issue and have a fix which should NOT be the final fix. Rather just a fix to get sparta working with Qt while the underlying problem is researched and a proper fix is created.
Here are the details:
When an existing project is opened with sparta is installed, and the existing project has one or more forms, in file "SourceFileManager.pas" method "TLazSourceFileManager.LoadLFM" is being recursively called without end.
The lines around 6433:
NewComponent:=FormEditor1.CreateRawComponentFromStream(BinStream, AnUnitInfo.UnitResourceFileformat, AncestorType,copy(NewUnitName,1,255),true,true,DisableAutoSize,AnUnitInfo);
Starts the recursion.
The LCL method:
procedure TWinControl.DoAllAutoSize;
Continues the recursion.
I think there is likely a problem in the LCL Qt specific code invoked somewhere within DoAllAutoSize is actually at fault, and not sparta.
Can someone more familiar with the LCL Qt widgetset take up a looking into this and creating a proper fix?
Thanks
Additional information:
The attached patch should be just an example to work around the problem. I think someone needs to look at the Qt widgetset and fix it so that it doesn't crash Lazarus by causing endless recursion.