本文整理汇总了C++中qstatemachine::SignalEvent::sender方法的典型用法代码示例。如果您正苦于以下问题:C++ SignalEvent::sender方法的具体用法?C++ SignalEvent::sender怎么用?C++ SignalEvent::sender使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstatemachine::SignalEvent
的用法示例。
在下文中一共展示了SignalEvent::sender方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventTest
bool SignalTransition::eventTest(QEvent *event)
{
Q_ASSERT(event);
if (!QSignalTransition::eventTest(event))
return false;
if (m_guard.isEmpty())
return true;
QQmlContext *outerContext = QQmlEngine::contextForObject(this);
QQmlContext context(outerContext);
QQmlContextData::get(outerContext)->imports->addref();
QQmlContextData::get(&context)->imports = QQmlContextData::get(outerContext)->imports;
QStateMachine::SignalEvent *e = static_cast<QStateMachine::SignalEvent*>(event);
// Set arguments as context properties
int count = e->arguments().count();
QMetaMethod metaMethod = e->sender()->metaObject()->method(e->signalIndex());
for (int i = 0; i < count; i++)
context.setContextProperty(metaMethod.parameterNames()[i], QVariant::fromValue(e->arguments().at(i)));
QQmlExpression expr(m_guard, &context, this);
QVariant result = expr.evaluate();
return result.toBool();
}
示例2: eventTest
/*!
\reimp
The default implementation returns true if the \a event is a
QStateMachine::SignalEvent object and the event's sender and signal index
match this transition, and returns false otherwise.
*/
bool QSignalTransition::eventTest(QEvent *event)
{
Q_D(const QSignalTransition);
if (event->type() == QEvent::StateMachineSignal) {
if (d->signalIndex == -1)
return false;
QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
return (se->sender() == d->sender)
&& (se->signalIndex() == d->signalIndex);
}
return false;
}
示例3: sipConvertFromType
static PyObject *meth_QStateMachine_SignalEvent_sender(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
{
QStateMachine::SignalEvent *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QStateMachine_SignalEvent, &sipCpp))
{
QObject *sipRes;
Py_BEGIN_ALLOW_THREADS
sipRes = sipCpp->sender();
Py_END_ALLOW_THREADS
return sipConvertFromType(sipRes,sipType_QObject,NULL);
}
}