Download

Undeclared identifier "ITableRow" when trying to use SClassViewer

When trying to use SClassViewer as so:


bool UPaperSkeletonAttachmentFactory::ConfigureProperties()
{
	AttachmentClass = nullptr;

	// Load the classviewer module to display a class picker
	FClassViewerModule& ClassViewerModule = FModuleManager::LoadModuleChecked<FClassViewerModule>("ClassViewer");

	// Fill in options
	FClassViewerInitializationOptions Options;
	Options.Mode = EClassViewerMode::ClassPicker;

	TSharedPtr<class FAttachmentClassFilter> Filter = MakeSharable(new FAttachmentClassFilter);
	Options.ClassFilter = Filter;

	Filter->AllowedChildrenOfClasses.Add(UPaperSkeletonAttachment::StaticClass());

	const FText TitleText = LOCTEXT("CreateAttachmentOptions", "Pick Attachment Class");
	UClass* ChosenClass = nullptr;
	const bool bPressedOk = SClassPickerDialog::PickClass(TitleText, Options, ChosenClass, UPaperSkeletonAttachment::StaticClass());

	if (bPressedOk)
	{
		AttachmentClass = ChosenClass;
	}

	return bPressedOk;
}

I am getting these errors when trying to build:


C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(31): error C2065: 'ITableRow' : undeclared identifier
1>C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(31): error C2923: 'TSharedRef' : 'ITableRow' is not a valid template type argument for parameter 'ObjectType'
1>C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(31): error C2065: 'FClassPickerDefaults' : undeclared identifier
1>C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(31): error C2923: 'TSharedPtr' : 'FClassPickerDefaults' is not a valid template type argument for parameter 'ObjectType'
1>C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(31): error C2065: 'STableViewBase' : undeclared identifier
1>C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(31): error C2923: 'TSharedRef' : 'STableViewBase' is not a valid template type argument for parameter 'ObjectType'
1>C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(68): error C2065: 'FClassPickerDefaults' : undeclared identifier
1>C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(68): error C2923: 'TSharedPtr' : 'FClassPickerDefaults' is not a valid template type argument for parameter 'ObjectType'
1>C:\Program Files\Unreal Engine\4.6\Engine\Source\Editor\UnrealEd\Public\Kismet2\SClassPickerDialog.h(68): error C3203: 'TSharedPtr' : unspecialized class template can't be used as a template argument for template parameter 'InElementType', expected a real type

I’ve tried including more dependencies to see if it would fix the problem to no avail.

Any help would be appreciated!

( AnswerHub Reference )

Hi,

Im using different method to get class picker but maybe it will help you, Im doing it like this:


TSharedRef<SWidget> GetClassPickerContent()
	{
		FClassViewerModule& ClassViewerModule = FModuleManager::LoadModuleChecked<FClassViewerModule>("ClassViewer");

		FClassViewerInitializationOptions Options;
		Options.Mode = EClassViewerMode::ClassPicker;
		Options.DisplayMode = EClassViewerDisplayMode::TreeView;
		Options.bIsActorsOnly = true;


		return SNew(SBox)
			.WidthOverride(350)
			.HeightOverride(500)
			
				SNew(SScrollBox)
				+ SScrollBox::Slot()
				
					ClassViewerModule.CreateClassViewer(Options, FOnClassPicked::CreateRaw(this, &STemplateTabContent::OnClassPicked))
				]
			];
			
	}

while my “includes” looks like this:


#include "ClassViewerModule.h"
#include "ClassViewerFilter.h"
#include "KismetEditorUtilities.h"
#include "SClassPickerDialog.h"