3

Is it possible to add new GUI elements into a Qt program using QtScript? For instance assuming the variable "layout" is a vertical layout would this be acceptable?

var label = new QLabel("Text");
layout.addWidget(label);
codeincarnate
  • 845
  • 7
  • 13

1 Answers1

4

Qt doesn't ship with QtScript bindings; which bindings are you using?

If you're using the bindings generator on Qt Labs, yes, this code would work fine, assuming you arranged for the `layout' variable to be imported into your script engine.

rohanpm
  • 4,264
  • 17
  • 16
  • Ah, didn't realize that the bindings for QtScript needed to be generated. I guess I'll be using the bindings made by the generator. Thanks! – codeincarnate Jul 21 '09 at 05:56