[Qt] Patch for GetContainterWidget

zeljko zeljko at holobit.net
Sun Jun 24 12:40:51 CEST 2007


On Sunday 24 June 2007 09:22, Felipe Monteiro de Carvalho wrote:
> Commited, but I opted for a different organization of the code to fix
> this. Please test.

it's ok, I've fixed another really BIG problem.
Case:
1.Assign OnCloseQuery() of some form (eg. modal).
  put there something like
  CanClose := MessageDlg('Close this form ??',mtConfirmation, [mbYes, mbNo], 
0);

2.Put one button onto form and assign OnClick() event, inside event put Close;

3.Now start app and call this small example form.
 a). When you click on Button, it will ask you about closing , and everything 
is fine.
 b). When you click on X (close button on form title), form dissapears, and no 
matter what did you answer , form is dead.

Solution:
QWidget have closeEvent (which by default accepts QCloseEvent) protected 
function which cannot be overriden just like that via our bindings, but I've 
found a solution how to override this void, and now it works like a charm.
Qt bindings need an small update for this to work.

Anyone interested ?



More information about the Qt mailing list