Howdy!
Native programing is more nasty than I thought. So I came across the nested class definition (in SScissorRectBox.h)
class SLATE_API SScissorRectBox : public SPanel
{
public:
class FScissorRectSlot : public TSupportsOneChildMixin<FScissorRectSlot>
{
public:
FScissorRectSlot(SWidget* InOwner)
: TSupportsOneChildMixin<FScissorRectSlot>(InOwner)
{}
};
SLATE_BEGIN_ARGS(SScissorRectBox)
{
_Visibility = EVisibility::SelfHitTestInvisible;
_Clipping = EWidgetClipping::ClipToBounds;
}
SLATE_DEFAULT_SLOT(FArguments, Content)
SLATE_END_ARGS()
void Construct( const FArguments& InArgs );
/**
* See the Content slot.
*/
void SetContent(const TSharedRef< SWidget >& InContent);
private:
virtual FVector2D ComputeDesiredSize(float) const override;
virtual void OnArrangeChildren( const FGeometry& AllottedGeometry, FArrangedChildren& ArrangedChildren ) const override;
virtual FChildren* GetChildren() override;
virtual int32 OnPaint( const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled ) const override;
FScissorRectSlot ChildSlot;
};
for which the object declaration in the following fashion
TSharedPtr<SScissorRectBox> ScissorRectBox = SNew(SScissorRectBox)[RebuildListWidget()];
where RebuildListWidget() is declared as
virtual TSharedRef<SListView<UObject*>> RebuildListWidget();
yields the error
default constructor of 'SScissorRectBox' is implicitly deleted because field 'ChildSlot' has no default constructor
FScissorRectSlot ChildSlot;
Now it makes me think that the additional lines
class FScissorRectSlot : public TSupportsOneChildMixin<FScissorRectSlot>
{
public:
FScissorRectSlot(SWidget* InOwner)
: TSupportsOneChildMixin<FScissorRectSlot>(InOwner)
{}
FScissorRectSlot()
{}
};
should rectify the error. I haven’t compiled the code because it means changing the Engine code. Just looking for the second opinion