#1085·nodegui

Beginner question about Node-GUI

Author: Angor-de-RedjakCreated Mar 1, 2026Updated May 12, 2026

Describe the bug I keep getting rootview.layout.addWidget and I do not understand why when I'm reading the API...

Sample of my code

javascript
const { 
	QMainWindow,
	QWidget, 
	QLabel, 
	QLayout,
	QPushButton, 
	QIcon, 
	QBoxLayout, 
	Direction, 
	FlexLayout
} = require("@nodegui/nodegui");
const path = require("path");

function main() {
	const rootview = new QWidget();
	rootview.setLayout(new FlexLayout());
	rootview.setObjectName("rootView");

	const label = new QLabel();
	label.setObjectName("label");
	label.setText("Import");

	const view = new QWidget();
	view.setObjectName("view");
	rootview.layout.addWidget(label);

	const win = new QMainWindow();
	win.setWindowTitle("Playlist Music TTRPG Manager");
	win.resize(1400, 1000);
	win.show();
	global.win = win;
}
main();

end of the code

Expected behavior I'm just trying to complete basic tutorial since a week ago and I'm still stuck on the matter. Do I lack something in my code for it to be recognize a XXX.layout.addWidget() as a function?

Please don't tell me it's because I'm coding in commonJS and it only works with typescript...

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: W10
  • NodeGUI version 0.74.0
  • OS Version 22H2 KB5075912

Additional context Hi, first time trying to dev a GUI and I'm trying with nodegui. I was looking for a discord nodegui dev-based community, but couldn't find one. Hence me making an issue for what's probably the easiest thing you'll ever see here. But I'm seriously losing hope here, so if somebody is able to help me, I'll gladly take it...