The QGridLayout class lays out widgets in a grid.
This class is a JS wrapper around Qt's QGridLayout
QGridLayout inherits from NodeLayout
Example
const { QGridLayout, QWidget, QLabel } = require("@nodegui/nodegui");const view = new QWidget();const layout = new QGridLayout();view.setLayout(layout);const label = new QLabel();label.setText("label1");const label2 = new QLabel();label2.setText("label2");layout.addWidget(label);layout.addWidget(label2);
Static Methods
QGridLayout can access all the static methods defined in NodeLayout
Instance Properties
QGridLayout can access all the instance properties defined in NodeLayout
Instance Methods
QGridLayout can access all the instance methods defined in NodeLayout
Additionally it also has the following instance methods:
layout.addWidget(childWidget)
Adds the childWidget to the layout. It calls the native method QGridLayout QGridLayout: addWidget.
childWidgetNodeWidget - child widget that needs to be added to the layout.
layout.removeWidget(childWidget)
Removes the childWidget from the layout. It calls the native method of custom QGridLayout. QGridLayout: removeWidget.
childWidgetNodeWidget - child widget that needs to be added to the layout.