[Lazarus] how to find this error?

zeljko zeljko at holobit.net
Mon Jun 29 12:57:58 CEST 2015


On 06/29/2015 11:43 AM, FreeMan wrote:
> fpc r31177 lazarus r49465 qt x64 osx
> my project work in osx qt64, win32 i386 qt is workas well, but in win64
> qt64 create "access violation" exception on "myform.Show;"
> on form has a "TStatusBar"
> I := TStatusBar.Canvas.TextWidth(TStatusBar.Panels[0].Text);
> this code has create exception in win64 too.
> when I wrote this message,
> http://forum.lazarus.freepascal.org/index.php/topic,27706.0.html same
> form and same my code worked, I mean my code not changed but not working
> now. I remark this line and re try run under win64, but still raise
> exception when use myForm.Show;
> I can not trace this exception, I added onShow event but not trigger.
> raise exception and terminate application.
> whats yours suggestion? TStatusBar bar has a bug ?? or what can be
> problem ?

TStatusBar.Canvas.TextWidth() needs Canvas.Handle when you use it. 
Canvas.Handle isn't available until there's no paintevent on TQtWidget 
handle, so that may be problem.
Try to use temporary bitmap for text measuring and see if it works.

zeljko





More information about the Lazarus mailing list