[Qt] QT patch - regressions

zeljko zeljko at holobit.net
Thu Jan 25 13:28:11 CET 2007


On Thursday 25 January 2007 00:16, Jesus Reyes wrote:
> fixed some in r10503, can you check again? The StatusBar  simpletext
> at handle creating needs review though.

I've seen your fix, but there is better way to do it if we need to setText() 
of control while creating ...
I've fixed such creation in different way ... like this (eg. TQtCheckBox).

function TQtCheckBox.CreateWidget(const AParams: TCreateParams): QWidgetH;
var
  Str: WideString;
  Parent: QWidgetH;
begin
  // Creates the widget
  {$ifdef VerboseQt}
    WriteLn('TQtCheckBox.Create');
  {$endif}

  Str := UTF8Decode(LCLObject.Caption);
  
  if (LCLObject.Parent is TCustomCheckGroup) then
  begin
    Result := QCheckBox_create(@Str); // <- Set text immediatelly
    QLayout_addWidget(TQtGroupBox(LCLObject.Parent.Handle).VBoxLayout, 
Result);
  end
  else
  begin
    Parent := TQtWidget(LCLObject.Parent.Handle).Widget;
    Result := QCheckBox_create(@Str,Parent); // <- Set text immediatelly
//    inherited SetGeometry;
  end;

  // SetText(@Str);
end;

cheers





More information about the Qt mailing list