Hi,

On 29. juni 2010 16:58, ext Cristian Daniel Stamateanu wrote:
> Hello,
>
> I have the following problem : I have a class declaring the following slot:
>
> void RssFeedManager::addFeedEx(const QScriptValue&  name,const
> QScriptValue&  address )
> {
>           bool nameIsString = name.isVariant();
>           QString str = name.toString();
>          ...
> }
>
> and I am calling this slot from QML
>
> This works ok:
> feedManager.addFeedEx( "whatever", addFeedView.address );
>
> while using a binding to a property declared in addFeedView like
> property string name;
>
> feedManager.addFeedEx( addFeedView.name, addFeedView.address );
>
> is not working.
> In the c++ side I am getting a string only it is an empty one.
>
> Any thoughts?
>    

Have you checked that the name is indeed non-empty on the JS side?
Does it work if you declare the slot as taking a QString argument (why 
do want to receive it as a QScriptValue)?
What type is the script value, is it an object? If so, does 
QScriptValue::toVariant() return anything? QML has a special "hook" to 
allow converting a script value to a variant, but no hook for the 
toString case AFAICT.

Regards,
Kent
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to