コード例 #1
0
static QScriptValue contextInfoToScriptValue(QScriptEngine *eng, const QScriptContextInfo &in)
{
    QScriptValue out = eng->newObject();
    out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId())));
    out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName()));
    out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber()));
    out.setProperty(QString::fromLatin1("columnNumber"), QScriptValue(eng, in.columnNumber()));
    out.setProperty(QString::fromLatin1("functionName"), QScriptValue(eng, in.functionName()));
    return out;
}
コード例 #2
0
void Frame::setContextInfo( const QScriptContextInfo &info, bool global )
{
    QString contextString = info.functionName();
    if ( contextString.isEmpty() ) {
        contextString = global ? "<global>" : "<anonymous>";
    }

    m_contextInfo = info;
    m_contextString = contextString;
    if ( m_model ) {
        m_model->frameChanged( this );
    }
}