Qt: add user interface elements with Qt Script

Can I add new GUI elements to a Qt program using QtScript? For example, assuming the variable "layout" is a vertical layout, would that be acceptable?

var label = new QLabel("Text");
layout.addWidget(label);
+3
source share
1 answer

Qt does not come with QtScript bindings; what bindings do you use?

If you use the binding generator in Qt Labs, yes, this code will work fine, assuming you have configured the `layout 'variable to import into your script engine.

+4
source

Source: https://habr.com/ru/post/1713120/


All Articles