Expression qt.QWidget(parent) returns a new widget. The optional argument parent specifies the widget parent. New widgets are always created from the main thread using the thread hopping mechanism.

When argument parent is nil or not specified, the new widget is owned by the Lua interpreter and is automatically destroyed when the garbage collector determines that it is no longer referenced.