After ApplyPropertyCache runs and the widget's state is set to wsReady, the base TQTXWidget constructor calls the virtual ObjectReady method.


This is the ideal and safest place for you, the component creator, to put final setup logic that requires a fully live DOM element.


Use ObjectReady to:


  • Attach internal delegates for your control's functionality.
  • Create complex child controls that weren't needed in the constructor.
  • Perform any initial measurements on the Handle.


For example, TQTXCustomButton overrides ObjectReady to attach its internal click delegate. TQTXCheckbox uses it to attach delegates to its internal checkmark and label.


procedure TMyWidget.ObjectReady;

begin

 inherited;

 // This code runs *after* the widget is live and styled.

 // It's safe to attach event listeners now.

 AddPointerDownDelegate(@HandlePointerDown);

end;