> For the complete documentation index, see [llms.txt](https://docs.oserosuite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oserosuite.com/technical-notes/unreal-engine-notes/slate/cast-between-different-slate-classes.md).

# Cast Between Different Slate Classes

Use `StaticCastSharedPtr`.

Example:

```cpp
TSharedPtr<SWidget> Parent = GetParentWidget();
TSharedPtr<SSH_TEX_ToolBase> ToolBase = StaticCastSharedPtr<SSH_TEX_ToolBase>(Parent);
```

{% hint style="warning" %}
Make sure to check `ToolBase.IsValid()` before using like a nullptr check!
{% endhint %}

### Reference

{% embed url="<https://georgy.dev/posts/cast-slate-widget-pointer/>" %}
