x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

SDetailsView - how to use outside PropertyEditor

I need SDetailsView widget in my editor module. But when I try to use it,I get bayzlion of linking errors:

 GAEffectSpecStructCustomization.cpp.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl SDetailsViewBase::~SDetailsViewBase(void)" (??1SDetailsViewBase@@UEAA@XZ) referenced in function "int `public: __cdecl SDetailsView::SDetailsView(void)'::`1'::dtor$0" (?dtor$0@?0???0SDetailsView@@QEAA@XZ@4HA)
 11>GAEffectSpecStructCustomization.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl SDetailsViewBase::HideFilterArea(bool)" (?HideFilterArea@SDetailsViewBase@@UEAAX_N@Z)
 11>GAEffectSpecStructCustomization.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class TArray<class FPropertyPath,class FDefaultAllocator> __cdecl SDetailsViewBase::GetPropertiesInOrderDisplayed(void)const " (?GetPropertiesInOrderDisplayed@SDetailsViewBase@@UEBA?AV?$TArray@VFPropertyPath@@VFDefaultAllocator@@@@XZ)
 11>GAEffectSpecStr

and so on.

So far I tried to include:

 #include "IDetailsView.h"
 #include "PropertyEditorModule.h"
 #include "Editor/PropertyEditor/Public/PropertyEditing.h"
 #include "Editor/PropertyEditor/Private/IDetailsViewPrivate.h"
 #include "Editor/PropertyEditor/Private/SDetailsViewBase.h"
 #include "Editor/PropertyEditor/Private/SDetailsView.h"

To no affair. I don't know what else I would need to get it working.

Product Version: UE Github Master branch
Tags:
more ▼

asked Jan 19 '17 at 01:24 AM in C++ Programming

avatar image

iniside
1.6k 101 96 181

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Update: This is not the best way to do it. See my other answer.

My previous, not recommended method:

SDetailsView doesn't seem supposed to be used outside private engine code. It's even defined in a Private folder.

If your goal is to create a details panel like the World Settings one, you can use SSingleObjectDetailsPanel. You just need to add #import "SSingleObjectDetailsPanel" to your code and add "KismetWidgets" to your module's .build.cs file, in PrivateDependencyModuleNames.

Then, create a widget class extending from SSingleObjectDetailsPanel and implement the correct methods. I guess a good and straight-forward example in the engine is the details panel for the SpriteEditor in Paper2D. Take a look at the file Engine\Plugins\2D\Paper2D\Source\Paper2DEditor\Private\SpriteEditor.cpp:252

more ▼

answered Dec 18 '18 at 08:23 AM

avatar image

RVillani
1.1k 27 37 89

(comments are locked)
10|2000 characters needed characters left

Better, easier way!

Found another way, even simpler and used with much more frequency in the engine source, so it's probably the newest/better way to do it (because we know Paper2D, where I got my previous answer from, hasn't been updated in a while).

Using the IDetailsView interface, the process is pretty straight forward. And the way it's instantiated, you're actually using a SDetailsView, just indirectly.

  1. Create a FDetailsViewArgs variable to set the detail view's settings.

  2. Use FPropertyEditorModule::CreateDetailView to create an IDetailsView instance.

  3. Pass your UObject instance that needs its properties displayed to the IDetailsView::SetObject method.

  4. Add the IDetailsView instance as some widget's child.

I'm using it as a child in a custom widget, but in the engine code, on the World Settings tab creation, they just used the IDetailsView directly. Here's a shortened snippet of that as an example:

 // includes
 #include "PropertyEditorModule.h"
 #include "IDetailsView.h"
 ...
 
 // setup the detail view settings
 FDetailsViewArgs DetailsViewArgs( false, false, true, FDetailsViewArgs::HideNameArea, false, GUnrealEd );
 DetailsViewArgs.bShowActorLabel = false;
 
 // create the detail view widget
 WorldSettingsView = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor").CreateDetailView( DetailsViewArgs );
 
 // set the object to have its properties displayed
 WorldSettingsView->SetObject(GetWorld()->GetWorldSettings());
 
 // create the tab with the details view in it
 return SNew( SDockTab )
     [
         WorldSettingsView.ToSharedRef()
     ];

You also need to add "KismetWidgets" to your module's .build.cs file, in PrivateDependencyModuleNames.

more ▼

answered Dec 18 '18 at 12:22 PM

avatar image

RVillani
1.1k 27 37 89

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question