# SGraphNode has an empty constructor? How to create new node?

**URL:** <https://forums.unrealengine.com/t/sgraphnode-has-an-empty-constructor-how-to-create-new-node/2739635>\
**Category:** Programming & Scripting\
**Tags:** ue4-editor, Code-Plugins, unreal-engine, CPP\
**Created:** [July 30, 2026, 9:14pm UTC](https://forums.unrealengine.com/t/sgraphnode-has-an-empty-constructor-how-to-create-new-node/2739635 "2026-07-30T21:14:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eliasfrost](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliasfrost/32/1088157_2.png) [@eliasfrost](https://forums.unrealengine.com/u/eliasfrost)\
**Post date:** [July 30, 2026, 9:14pm UTC](https://forums.unrealengine.com/t/sgraphnode-has-an-empty-constructor-how-to-create-new-node/2739635/1 "2026-07-30T21:14:29Z")

</div>

Hi, I’m trying to create a new custom node in my plugin but I’m having a bit of a problem. I have this NodeFactory here:

```cpp
struct FDialogGraphNodeFactory : public FGraphPanelNodeFactory
{
public:
	virtual ~FDialogGraphNodeFactory() {}
	virtual TSharedPtr<class SGraphNode> CreateNode(class UEdGraphNode* Node) const override
	{
		if (UDialogGraphNode* NodeAsDialogNode = Cast<UDialogGraphNode>(Node)){
			return SNew(SDialogGraphNodeWidget, NodeAsDialogNode);
		}
		return nullptr;
	}
};

```

In my class derived from SGraphNode I have this:

```cpp
class SDialogGraphNodeWidget : public SGraphNode
{
public:
	SLATE_BEGIN_ARGS(SDialogGraphNodeWidget)
	{}

	SLATE_END_ARGS()
	
	void Construct(const FArguments& InArgs, UEdGraphNode* InNode)
	{
		SGraphNode::Construct(); // This constructor is actually in SPanel and not in SGraphNode. It's also empty
	}
};

```

The problem is that in the factory when I try to return SNew(SDialogGraphNodeWidget, NodeAsDialogNode); I get an error saying that the Constructor takes no arguments. My question is: if the constructor takes no arguments, how am I supposed to use SNew()? SNew() can’t be empty, but you also can’t add anything to it?

Can someone help me make sense of this?

---

<div class="post-metadata">

**Author:** ![eliasfrost](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliasfrost/32/1088157_2.png) [@eliasfrost](https://forums.unrealengine.com/u/eliasfrost)\
**Post date:** [July 30, 2026, 9:35pm UTC](https://forums.unrealengine.com/t/sgraphnode-has-an-empty-constructor-how-to-create-new-node/2739635/2 "2026-07-30T21:35:01Z")

</div>

![UnresolvedExternal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/4/9b41fed5a5d54441d8c1aae0933e66bccbbc34b1.png)

When I try running as is. I get this unresolved external error, pointing to this function here. I have Slate and SlateCore in my dependencies, I have also included Slate in the header files. Any ideas?

---

<div class="post-metadata">

**Author:** ![eliasfrost](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliasfrost/32/1088157_2.png) [@eliasfrost](https://forums.unrealengine.com/u/eliasfrost)\
**Post date:** [July 31, 2026, 6:51am UTC](https://forums.unrealengine.com/t/sgraphnode-has-an-empty-constructor-how-to-create-new-node/2739635/3 "2026-07-31T06:51:21Z")

</div>

No one?

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [July 31, 2026, 3:42pm UTC](https://forums.unrealengine.com/t/sgraphnode-has-an-empty-constructor-how-to-create-new-node/2739635/4 "2026-07-31T15:42:32Z")

</div>

I used this function to replace the widget:

```auto
TSharedPtr<SGraphNode> UOGNode_ComboGate::CreateVisualWidget()
{
	return SNew(SGraphNodeOGComboGate, this);
}

```

\*I don’t remember why I did it this way a long time ago, but it worked… 😅  
I probably had problems with the factory just like you did…

---

<div class="post-metadata">

**Author:** ![BRGEzedeRocco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgezederocco/32/1216890_2.png) [@BRGEzedeRocco](https://forums.unrealengine.com/u/BRGEzedeRocco)\
**Post date:** [July 31, 2026, 6:32pm UTC](https://forums.unrealengine.com/t/sgraphnode-has-an-empty-constructor-how-to-create-new-node/2739635/5 "2026-07-31T18:32:24Z")

</div>

Hello @eliasfrost ,  
There’s no need to call **Construct** in your class derived from **SGraphNode**. Instead, the widget should be built inside **UpdateGraphNode,** as that’s the method intended for constructing and updating the node’s content.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/8/b089e6deba7291f0d0c53c67c4250cb730862217.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/9/ed9cadf076754de744dd307b727b1f5249a4747b.png)

Regarding the linking error, it’s most likely because the **EditorStyle** module isn’t linked in your YourProjectEditor.Build.cs . As a recommendation, instead of using FEditorStyle, you should use FAppStyle, as it’s the recommended API in newer versions of the engine.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/f/42f0e10332da7cff00fa69e3d89da671eb37111c.png)

Finally, don’t forget to register your GraphNodeFactory during your module’s initialization ; otherwise, the editor won’t be able to use your custom node implementation.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/0/010e44d619fd229b913038cc701a56737f2d631d.png)

Hope it helps!
