dioselin
15th April 2010, 00:24
Hello,
In exposing my C++ objects to javascript, I have properties of types QSizeF, QColor and other Qt types:
class Control : public QGraphicsWidget{
Q_OBJECT
Q_PROPERTY (QSizeF size READ getSize WRITE setSize )
Q_PROPERTY (QColor bgColor READ getBgColor WRITE setBgColor)
...
}
These properties are converted to Variant in javascript, so this code won't work :
myControl = new Control();
myControl.size.height = 40;
What do I have to do to access these properties in javascript? Do I have to set a default prototype for QSizeF and others, or do I have to create my own Size,Color, classes?
Thank you,
In exposing my C++ objects to javascript, I have properties of types QSizeF, QColor and other Qt types:
class Control : public QGraphicsWidget{
Q_OBJECT
Q_PROPERTY (QSizeF size READ getSize WRITE setSize )
Q_PROPERTY (QColor bgColor READ getBgColor WRITE setBgColor)
...
}
These properties are converted to Variant in javascript, so this code won't work :
myControl = new Control();
myControl.size.height = 40;
What do I have to do to access these properties in javascript? Do I have to set a default prototype for QSizeF and others, or do I have to create my own Size,Color, classes?
Thank you,