[Qt] Qt deffered deletion (QObject_deleteLater())

zeljko zeljko at holobit.net
Wed Jan 14 09:36:04 CET 2009


On Wednesday 14 January 2009 08:29, Paul Ishenin wrote:
> zeljko wrote:
> > I'll commit it with USE_QT_44 ifdef.
>
> You want to commit even with problems with Timer and PopupMenu?
>
> What about this code:
>
> [code]
> unit Unit1;
> {$mode objfpc}{$H+}
> interface
> uses
>    Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics,
> Dialogs,
>    StdCtrls, LMessages, LCLIntf;
> type
>    TForm1 = class(TForm)
>      Button1: TButton;
>      procedure Button1Click(Sender: TObject);
>    private
>      procedure LM_USER1(var Message: TLMessage); message LM_USER + 1;
>    public
>      { public declarations }
>    end;
> var
>    Form1: TForm1;
> implementation
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>    PostMessage(Handle, LM_USER + 1, 0, 0);
> end;
> procedure TForm1.LM_USER1(var Message: TLMessage);
> begin
>    Button1.Free;
> end;
> initialization
>    {$I unit1.lrs}
> end.
> [/code]
>
> On windows this works. Will it work on qt after your changes (did not
> test current version).

It works.



More information about the Qt mailing list