Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtScript.QScriptContextInfo Class Reference

The QScriptContextInfo class provides additional information about a QScriptContext. More...

Inheritance diagram for QtScript.QScriptContextInfo:
Collaboration diagram for QtScript.QScriptContextInfo:

Public Types

enum  FunctionType { NativeFunction = 3, QtFunction = 1, QtPropertyFunction = 2, ScriptFunction = 0 }
  More...
 

Public Member Functions

override bool Equals (object o)
 
override int GetHashCode ()
 
 QScriptContextInfo ()
 
 
 QScriptContextInfo (QScriptContext context)
 
 
 QScriptContextInfo (QScriptContextInfo other)
 
 
virtual void CreateProxy ()
 
new int ColumnNumber ()
 
new string FileName ()
 
 
new int FunctionEndLineNumber ()
 
 
new int FunctionMetaIndex ()
 
 
new string FunctionName ()
 
 
new
System.Collections.Generic.List
< string > 
FunctionParameterNames ()
 
 
new int FunctionStartLineNumber ()
 
 
new QScriptContextInfo.FunctionType functionType ()
 
 
new bool IsNull ()
 
 
new int LineNumber ()
 
 
new long ScriptId ()
 
 
new void Dispose ()
 

Static Public Member Functions

static bool operator!= (QScriptContextInfo arg1, QScriptContextInfo arg2)
 
 
static bool operator== (QScriptContextInfo arg1, QScriptContextInfo arg2)
 
 

Protected Member Functions

 QScriptContextInfo (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QScriptContextInfo class provides additional information about a QScriptContext.

QScriptContextInfo is typically used for debugging purposes. It can provide information about the code being executed, such as the type of the called function, and the original source code location of the current statement.

If the called function is executing Qt Script code, you can obtain the script location with the functions fileName() and lineNumber().

You can obtain the starting line number and ending line number of a Qt Script function definition with functionStartLineNumber() and functionEndLineNumber(), respectively.

For Qt Script functions and Qt methods (e.g. slots), you can call functionParameterNames() to get the names of the formal parameters of the function.

For Qt methods and Qt property accessors, you can obtain the index of the underlying QMetaMethod or QMetaProperty by calling functionMetaIndex().

See also QScriptContext and QScriptEngineAgent.

Member Enumeration Documentation

This enum specifies the type of function being called.

Enumerator:
NativeFunction 

The function is a built-in Qt Script function, or it was defined through a call to QScriptEngine::newFunction().

QtFunction 

The function is a Qt function (a signal, slot or method).

QtPropertyFunction 

The function is a Qt property getter or setter.

ScriptFunction 

The function is a Qt Script function, i.e. it was defined through a call to QScriptEngine::evaluate().

Constructor & Destructor Documentation

QtScript.QScriptContextInfo.QScriptContextInfo ( System.Type  dummy)
protected
QtScript.QScriptContextInfo.QScriptContextInfo ( )

Constructs a null QScriptContextInfo.

See also isNull().

QtScript.QScriptContextInfo.QScriptContextInfo ( QScriptContext  context)

Constructs a new QScriptContextInfo from the given context.

The relevant information is extracted from the context at construction time; i.e. if you continue script execution in the context, the new state of the context will not be reflected in a previously created QScriptContextInfo.

QtScript.QScriptContextInfo.QScriptContextInfo ( QScriptContextInfo  other)

Constructs a new QScriptContextInfo from the other info.

Member Function Documentation

new int QtScript.QScriptContextInfo.ColumnNumber ( )
virtual void QtScript.QScriptContextInfo.CreateProxy ( )
virtual
new void QtScript.QScriptContextInfo.Dispose ( )
override bool QtScript.QScriptContextInfo.Equals ( object  o)
new string QtScript.QScriptContextInfo.FileName ( )

Returns the name of the file where the code being executed was defined, if available; otherwise returns an empty string.

For Qt Script code, this function returns the fileName argument that was passed to QScriptEngine::evaluate().

See also lineNumber() and functionName().

new int QtScript.QScriptContextInfo.FunctionEndLineNumber ( )

Returns the line number where the definition of the called function ends, or -1 if the line number is not available.

The ending line number is only available if the functionType() is ScriptFunction.

See also functionStartLineNumber().

new int QtScript.QScriptContextInfo.FunctionMetaIndex ( )

Returns the meta index of the called function, or -1 if the meta index is not available.

The meta index is only available if the functionType() is QtFunction or QtPropertyFunction. For QtFunction, the meta index can be passed to QMetaObject::method() to obtain the corresponding method definition; for QtPropertyFunction, the meta index can be passed to QMetaObject::property() to obtain the corresponding property definition.

See also QScriptContext::thisObject().

new string QtScript.QScriptContextInfo.FunctionName ( )

Returns the name of the called function, or an empty string if the name is not available.

For script functions of type QtPropertyFunction, this function always returns the name of the property; you can use QScriptContext::argumentCount() to differentiate between reads and writes.

See also fileName() and functionType().

new System.Collections.Generic.List<string> QtScript.QScriptContextInfo.FunctionParameterNames ( )

Returns the names of the formal parameters of the called function, or an empty QStringList if the parameter names are not available.

See also QScriptContext::argument().

new int QtScript.QScriptContextInfo.FunctionStartLineNumber ( )

Returns the line number where the definition of the called function starts, or -1 if the line number is not available.

The starting line number is only available if the functionType() is ScriptFunction.

See also functionEndLineNumber() and fileName().

new QScriptContextInfo.FunctionType QtScript.QScriptContextInfo.functionType ( )

Returns the type of the called function.

See also functionName() and QScriptContext::callee().

override int QtScript.QScriptContextInfo.GetHashCode ( )
new bool QtScript.QScriptContextInfo.IsNull ( )

Returns true if this QScriptContextInfo is null, i.e. does not contain any information.

new int QtScript.QScriptContextInfo.LineNumber ( )

Returns the line number corresponding to the statement being executed, or -1 if the line number is not available.

The line number is only available if Qt Script code is being executed.

See also columnNumber() and fileName().

static bool QtScript.QScriptContextInfo.operator!= ( QScriptContextInfo  arg1,
QScriptContextInfo  arg2 
)
static

Returns true if this QScriptContextInfo is not equal to the other info, otherwise returns false.

static bool QtScript.QScriptContextInfo.operator== ( QScriptContextInfo  arg1,
QScriptContextInfo  arg2 
)
static

Returns true if this QScriptContextInfo is equal to the other info, otherwise returns false.

new long QtScript.QScriptContextInfo.ScriptId ( )

Returns the ID of the script where the code being executed was defined, or -1 if the ID is not available (i.e. a native function is being executed).

See also QScriptEngineAgent::scriptLoad().

Member Data Documentation

SmokeInvocation QtScript.QScriptContextInfo.interceptor
protected

Property Documentation

virtual System.IntPtr QtScript.QScriptContextInfo.SmokeObject
getset