QDeclarativeScriptString Class ReferenceThe QDeclarativeScriptString class encapsulates a script and its context. Далее... #include <QDeclarativeScriptString> Этот класс был введён в Qt 4.7. Открытые функции
Подробное описаниеThe QDeclarativeScriptString class encapsulates a script and its context. QDeclarativeScriptString is used to create QObject properties that accept a script "assignment" from QML. Normally, the following QML would result in a binding being established for the script property; i.e. script would be assigned the value obtained from running myObj.value = Math.max(myValue, 100) MyType { script: myObj.value = Math.max(myValue, 100) } If instead the property had a type of QDeclarativeScriptString, the script itself -- myObj.value = Math.max(myValue, 100) -- would be passed to the script property and the class could choose how to handle it. Typically, the class will evaluate the script at some later time using a QDeclarativeExpression. QDeclarativeExpression expr(scriptString.context(), scriptString.script(), scriptStr.scopeObject()); expr.value(); See also QDeclarativeExpression. Описание функций-членовQDeclarativeScriptString::QDeclarativeScriptString ()Constructs an empty instance. QDeclarativeScriptString::QDeclarativeScriptString ( const QDeclarativeScriptString & other )Copies other. QDeclarativeContext * QDeclarativeScriptString::context () constReturns the context for the script. See also setContext(). QObject * QDeclarativeScriptString::scopeObject () constReturns the scope object for the script. See also setScopeObject(). QString QDeclarativeScriptString::script () constReturns the script text. See also setScript(). void QDeclarativeScriptString::setContext ( QDeclarativeContext * context )Sets the context for the script. See also context(). void QDeclarativeScriptString::setScopeObject ( QObject * object )Sets the scope object for the script. See also scopeObject(). void QDeclarativeScriptString::setScript ( const QString & script )Sets the script text. See also script(). QDeclarativeScriptString & QDeclarativeScriptString::operator= ( const QDeclarativeScriptString & other )Assigns other to this. |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |