Qt 4.8
Public Functions | Properties | List of all members
QScript::QObjectData Class Reference

#include <qscriptqobject_p.h>

Public Functions

bool addSignalHandler (QObject *sender, int signalIndex, JSC::JSValue receiver, JSC::JSValue slot, JSC::JSValue senderWrapper, Qt::ConnectionType type)
 
QScriptObjectfindWrapper (QScriptEngine::ValueOwnership ownership, const QScriptEngine::QObjectWrapOptions &options) const
 
void mark (JSC::MarkStack &)
 
 QObjectData (QScriptEnginePrivate *engine)
 
void registerWrapper (QScriptObject *wrapper, QScriptEngine::ValueOwnership ownership, const QScriptEngine::QObjectWrapOptions &options)
 
bool removeSignalHandler (QObject *sender, int signalIndex, JSC::JSValue receiver, JSC::JSValue slot)
 
 ~QObjectData ()
 

Properties

QScript::QObjectConnectionManagerconnectionManager
 
QScriptEnginePrivateengine
 
QList< QScript::QObjectWrapperInfowrappers
 

Detailed Description

Definition at line 143 of file qscriptqobject_p.h.

Constructors and Destructors

◆ QObjectData()

QObjectData::QObjectData ( QScriptEnginePrivate engine)

Definition at line 2251 of file qscriptqobject.cpp.

2252  : engine(eng), connectionManager(0)
2253 {
2254 }
QScriptEnginePrivate * engine
QScript::QObjectConnectionManager * connectionManager

◆ ~QObjectData()

QObjectData::~QObjectData ( )

Definition at line 2256 of file qscriptqobject.cpp.

2257 {
2258  if (connectionManager) {
2259  delete connectionManager;
2260  connectionManager = 0;
2261  }
2262 }
QScript::QObjectConnectionManager * connectionManager

Functions

◆ addSignalHandler()

bool QObjectData::addSignalHandler ( QObject sender,
int  signalIndex,
JSC::JSValue  receiver,
JSC::JSValue  slot,
JSC::JSValue  senderWrapper,
Qt::ConnectionType  type 
)

Definition at line 2280 of file qscriptqobject.cpp.

Referenced by QScriptEnginePrivate::scriptConnect().

2286 {
2287  if (!connectionManager)
2288  connectionManager = new QObjectConnectionManager(engine);
2290  sender, signalIndex, receiver, slot, senderWrapper, type);
2291 }
QScriptEnginePrivate * engine
bool addSignalHandler(QObject *sender, int signalIndex, JSC::JSValue receiver, JSC::JSValue slot, JSC::JSValue senderWrapper, Qt::ConnectionType type)
static Type type(const QScriptValue &v)
QScript::QObjectConnectionManager * connectionManager

◆ findWrapper()

QScriptObject * QObjectData::findWrapper ( QScriptEngine::ValueOwnership  ownership,
const QScriptEngine::QObjectWrapOptions &  options 
) const

Definition at line 2304 of file qscriptqobject.cpp.

Referenced by QScriptEnginePrivate::newQObject().

2306 {
2307  for (int i = 0; i < wrappers.size(); ++i) {
2308  const QObjectWrapperInfo &info = wrappers.at(i);
2309  if ((info.ownership == ownership) && (info.options == options))
2310  return info.object;
2311  }
2312  return 0;
2313 }
QList< QScript::QObjectWrapperInfo > wrappers
static mach_timebase_info_data_t info
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ mark()

void QObjectData::mark ( JSC::MarkStack &  markStack)

Definition at line 2264 of file qscriptqobject.cpp.

Referenced by QScriptEnginePrivate::mark().

2265 {
2266  if (connectionManager)
2267  connectionManager->mark(markStack);
2268  {
2270  for (it = wrappers.begin(); it != wrappers.end(); ) {
2272  // ### don't mark if there are no other references.
2273  // we need something like isMarked()
2274  markStack.append(info.object);
2275  ++it;
2276  }
2277  }
2278 }
QList< QScript::QObjectWrapperInfo > wrappers
static mach_timebase_info_data_t info
#define it(className, varName)
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
Definition: qlist.h:267
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:270
QScript::QObjectConnectionManager * connectionManager
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ registerWrapper()

void QObjectData::registerWrapper ( QScriptObject wrapper,
QScriptEngine::ValueOwnership  ownership,
const QScriptEngine::QObjectWrapOptions &  options 
)

Definition at line 2315 of file qscriptqobject.cpp.

Referenced by QScriptEnginePrivate::newQObject().

2318 {
2319  wrappers.append(QObjectWrapperInfo(wrapper, ownership, options));
2320 }
QList< QScript::QObjectWrapperInfo > wrappers
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507

◆ removeSignalHandler()

bool QObjectData::removeSignalHandler ( QObject sender,
int  signalIndex,
JSC::JSValue  receiver,
JSC::JSValue  slot 
)

Definition at line 2293 of file qscriptqobject.cpp.

Referenced by QScriptEnginePrivate::scriptDisconnect().

2297 {
2298  if (!connectionManager)
2299  return false;
2301  sender, signalIndex, receiver, slot);
2302 }
bool removeSignalHandler(QObject *sender, int signalIndex, JSC::JSValue receiver, JSC::JSValue slot)
QScript::QObjectConnectionManager * connectionManager

Properties

◆ connectionManager

QScript::QObjectConnectionManager* QScript::QObjectData::connectionManager
private

Definition at line 170 of file qscriptqobject_p.h.

Referenced by addSignalHandler(), mark(), removeSignalHandler(), and ~QObjectData().

◆ engine

QScriptEnginePrivate* QScript::QObjectData::engine
private

Definition at line 169 of file qscriptqobject_p.h.

Referenced by addSignalHandler().

◆ wrappers

QList<QScript::QObjectWrapperInfo> QScript::QObjectData::wrappers
private

Definition at line 171 of file qscriptqobject_p.h.

Referenced by findWrapper(), mark(), and registerWrapper().


The documentation for this class was generated from the following files: