Hello.
I want to create SList with FStrings inside. Thats what I have:
Header:
TSharedRef<ITableRow> OnGenerateRowForList(TSharedPtr<FString> InItem, const TSharedRef<STableViewBase>& OwnerTable);
TSharedRef<class SDockTab> OnSpawnPluginTab(const class FSpawnTabArgs& SpawnTabArgs);
/* The list of strings */
TArray<TSharedPtr<FString>> Items;
/* The actual UI list */
TSharedPtr< SListView< TSharedPtr<FString> > > ListViewWidget;
Source:
TSharedRef<ITableRow> FAdvancedDialoguesModule::OnGenerateRowForList(TSharedPtr<FString> InItem, const TSharedRef<STableViewBase>& OwnerTable)
{
//Create the row
return
SNew(STableRow< TSharedPtr<FString> >, OwnerTable)
.Padding(2.0f)
[
SNew(STextBlock).Text(*InItem.Get())
];
}
...
[
SAssignNew(ListViewWidget, SListView<TSharedPtr<FString>>)
.ItemHeight(24)
.SelectionMode(ESelectionMode::Single)
.ListItemsSource(&Items) //The Items array is the source of this listview
.OnGenerateRow(this,&FAdvancedDialoguesModule::OnGenerateRowForList)
]
But when I try to compile:
C:\Program Files\Unreal Engine\4.12\Engine\Source\Runtime\Core\Public\Misc\Attribute.h(44): error C2248: 'FText::FText': cannot access private member declared in class 'FText'
1> c:\program files\unreal engine\4.12\engine\source\runtime\core\public\internationalization\Text.h(371): note: see declaration of 'FText::FText'
1> c:\program files\unreal engine\4.12\engine\source\runtime\core\public\internationalization\Text.h(139): note: see declaration of 'FText'
1> C:\Users\Hubert\Documents\Unreal Projects\RFG1 4.12\Plugins\AdvancedDialogues\Source\AdvancedDialogues\Private\AdvancedDialogues.cpp(66): note: see reference to function template instantiation 'TAttribute<FText>::TAttribute<ObjectType>(const OtherType &)' being compiled
1> with
1> [
1> ObjectType=FString,
1> OtherType=FString
1> ]
1> C:\Users\Hubert\Documents\Unreal Projects\RFG1 4.12\Plugins\AdvancedDialogues\Source\AdvancedDialogues\Private\AdvancedDialogues.cpp(62): note: see reference to function template instantiation 'TAttribute<FText>::TAttribute<ObjectType>(const OtherType &)' being compiled
1> with
1> [
1> ObjectType=FString,
1> OtherType=FString
1> ]
Can some help/exaplain whats wrong with this code?
Regards,
HRZ