[Qt] FPC Qt4 Binding V1.39

zeljko at holobit.net zeljko at holobit.net
Wed Jul 4 20:24:35 CEST 2007


Quoting Den Jean <Den.Jean at telenet.be>:

> On Wednesday 04 July 2007 09:44:27 am zeljko wrote:
>> No, Den it cannot work since we don't have anything like that in our qt-lcl
>> code. There's call to SlotClose() (which sends message to LCL) and that's
>> it. I didn't found any way how to catch some result from SlotClose().
>
> It also expected that you read/need the result from delivermessage,   
> but a test
> revealed that the result is not different with CanClose True or False in a
> FormCloseQuery.
>
> The design of SlotClose is up to you/Felipe.
> Probably with the "cdecl" Felipe wanted one day to connect stuff to these Qt
> compatible slots. But you can change it to a function and add parameters if
> you want.
>
> Here's a patch that implements CloseQuery:

sorry Den but this patch doesn't fix the problem,I've just tried it.
QWidget::closeEvent() is accepted by default, whatever you do in form  
OnCloseQuery() event,
--->>>>> but just when you close form via titlebar "X" button <---- ,
not when you close it via LCL call, like buttonPress()->Close().  
That's the point, Qt manages this click not LCL since LCL have nothing  
with minimize,maximize,close (titlebar) etc. buttons.
So when you click it , it's already accepted, all additional changes  
on this event are lost (eg. ignore).
Beleive me, I've spent few days in testing all solutions around this  
problem, and only closeEvent() overriding fixes things.

> Tested by creating an App with a Form with a CheckBox ECanClose.
> procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
> begin
>   CanClose:=ECanClose.Checked;
> end;
>
> The delivermessage and the convenience functions (LCLSendCloseQueryMsg) of
> LCLMessageGlue are really nice. I would really like that you overall  
>  use these
> functions.  It would reduce the size of QtWidgets.pas.

It's not problem to use messages, but some things have to be handled  
and interacted directly with qt.

zeljko




More information about the Qt mailing list