Qt 4.8
Public Functions | Public Variables | List of all members
QScript::QObjectConnection Struct Reference

Public Functions

bool hasTarget (JSC::JSValue r, JSC::JSValue s) const
 
void mark (JSC::MarkStack &markStack)
 
 QObjectConnection (int i, JSC::JSValue r, JSC::JSValue s, JSC::JSValue sw)
 
 QObjectConnection ()
 

Public Variables

JSC::JSValue receiver
 
JSC::JSValue senderWrapper
 
JSC::JSValue slot
 
int slotIndex
 

Detailed Description

Definition at line 62 of file qscriptqobject.cpp.

Constructors and Destructors

◆ QObjectConnection() [1/2]

QScript::QObjectConnection::QObjectConnection ( int  i,
JSC::JSValue  r,
JSC::JSValue  s,
JSC::JSValue  sw 
)
inline

◆ QObjectConnection() [2/2]

QScript::QObjectConnection::QObjectConnection ( )
inline

Definition at line 72 of file qscriptqobject.cpp.

Functions

◆ hasTarget()

bool QScript::QObjectConnection::hasTarget ( JSC::JSValue  r,
JSC::JSValue  s 
) const
inline

Definition at line 74 of file qscriptqobject.cpp.

Referenced by QScript::QObjectConnectionManager::removeSignalHandler().

75  {
76  if ((r && r.isObject()) != (receiver && receiver.isObject()))
77  return false;
78  if (((r && r.isObject()) && (receiver && receiver.isObject()))
79  && (r != receiver)) {
80  return false;
81  }
82  return (s == slot);
83  }

◆ mark()

void QScript::QObjectConnection::mark ( JSC::MarkStack &  markStack)
inline

Definition at line 85 of file qscriptqobject.cpp.

86  {
87  if (senderWrapper) {
88  // see if the sender should be marked or not;
89  // if the C++ object is owned by script, we don't want
90  // it to stay alive due to a script connection.
92  QScriptObject *scriptObject = static_cast<QScriptObject*>(JSC::asObject(senderWrapper));
93  if (!JSC::Heap::isCellMarked(scriptObject)) {
94  QScriptObjectDelegate *delegate = scriptObject->delegate();
95  Q_ASSERT(delegate && (delegate->type() == QScriptObjectDelegate::QtObject));
96  QObjectDelegate *inst = static_cast<QObjectDelegate*>(delegate);
97  if ((inst->ownership() == QScriptEngine::ScriptOwnership)
98  || ((inst->ownership() == QScriptEngine::AutoOwnership)
99  && inst->value() && !inst->value()->parent())) {
100  senderWrapper = JSC::JSValue();
101  } else {
102  markStack.append(senderWrapper);
103  }
104  }
105  }
106  if (receiver)
107  markStack.append(receiver);
108  if (slot)
109  markStack.append(slot);
110  }
virtual Type type() const =0
static const JSC::ClassInfo info
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Properties

◆ receiver

JSC::JSValue QScript::QObjectConnection::receiver

Definition at line 65 of file qscriptqobject.cpp.

Referenced by QScript::QObjectConnectionManager::execute().

◆ senderWrapper

JSC::JSValue QScript::QObjectConnection::senderWrapper

Definition at line 67 of file qscriptqobject.cpp.

Referenced by QScript::QObjectConnectionManager::execute().

◆ slot

JSC::JSValue QScript::QObjectConnection::slot

Definition at line 66 of file qscriptqobject.cpp.

Referenced by QScript::QObjectConnectionManager::execute().

◆ slotIndex

int QScript::QObjectConnection::slotIndex

The documentation for this struct was generated from the following file: