Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QSlotInvoker Class Reference
[QtBaseModule]

The QSlotInvoker class provides an interface for invoking slots with explicit arguments More...

    #include <QSlotInvoker>

Inherits QObject.

Public Functions

Public Slots

Additional Inherited Members


Detailed Description

The QSlotInvoker class provides an interface for invoking slots with explicit arguments

IPC mechanisms need to intercept protocol messages and convert them into slot invocations, but it is generally impractical to create explicit code for every slot that needs to be dispatched. The QSlotInvoker class allows an IPC dispatching mechanism to invoke slots in a generic fashion using the invoke() method.

Methods that are marked with Q_INVOKABLE or Q_SCRIPTABLE can also be invoked with this class.

See also QSignalIntercepter.


Member Function Documentation

QSlotInvoker::QSlotInvoker ( QObject * receiver, const QByteArray & member, QObject * parent = 0 )

Create a slot invoker that can invoke member on receiver. The object will be attached to parent, if present.

QSlotInvoker::~QSlotInvoker ()

Destroy a slot invoker.

bool QSlotInvoker::canInvoke ( int numArgs ) const

Returns true if the member can be invoked with numArgs arguments. That is, the receiver has not been destroyed, the member is present, and it requires numArgs or less arguments.

QVariant QSlotInvoker::invoke ( const QList<QVariant> & args )   [slot]

Invokes the slot represented by this object with the argument list args. The slot's return value is returned from this method. If the slot's return type is "void", then a QVariant instance of type QVariant::Invalid will be returned.

If it is possible that the slot may throw an exception, it is the responsibility of the caller to catch and handle the exception.

QByteArray QSlotInvoker::member () const

Returns the member that will receiver slot invocations.

bool QSlotInvoker::memberPresent () const

Returns true if the member is present on the object.

int * QSlotInvoker::parameterTypes () const

Returns the parameter types associated with this member.

int QSlotInvoker::parameterTypesCount () const

Returns the number of parameter types associated with this member.

QObject * QSlotInvoker::receiver () const

Returns the object that will receive slot invocations.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3