本文整理汇总了C++中qstatemachine::SignalEvent::arguments方法的典型用法代码示例。如果您正苦于以下问题:C++ SignalEvent::arguments方法的具体用法?C++ SignalEvent::arguments怎么用?C++ SignalEvent::arguments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstatemachine::SignalEvent
的用法示例。
在下文中一共展示了SignalEvent::arguments方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTransition
//virtual
void PropertySettingSignalTransition::onTransition(QEvent * e)
{
if (m_qp_targetObject)
{
QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
if (!se->arguments().isEmpty())
{
m_qp_targetObject->setProperty(m_propertyName.toLatin1().constData(),se->arguments().at(0));
}
}
QSignalTransition::onTransition(e);
}
示例2: onEntry
void ReorderState::onEntry(QEvent* event)
{
CardWindowManagerState::onEntry(event);
QStateMachine::SignalEvent* se = static_cast<QStateMachine::SignalEvent*>(event);
if (se && !se->arguments().isEmpty()) {
QPoint pt = se->arguments().at(0).toPoint();
m_wm->enterReorder(pt);
//int slice = se->arguments().at(1).toInt();
//m_grid = new ReorderGrid(m_wm, slice);
}
SystemUiController::instance()->enterOrExitCardReorder(true);
}
示例3: onExit
void ReorderState::onExit(QEvent* event)
{
CardWindowManagerState::onExit(event);
QStateMachine::SignalEvent* se = static_cast<QStateMachine::SignalEvent*>(event);
if (se && !se->arguments().isEmpty()) {
bool canceled = se->arguments().at(0).toBool();
if (canceled)
m_wm->cancelReorder();
}
//delete m_grid;
SystemUiController::instance()->enterOrExitCardReorder(false);
}
示例4: eventTest
bool ReceivedMessageTransition::eventTest(QEvent* event) {
if (!QSignalTransition::eventTest(event)) {
return false;
}
QStateMachine::SignalEvent* signalEvent = static_cast<QStateMachine::SignalEvent*>(event);
const QVariant& qVariant(signalEvent->arguments().at(0));
if (!qVariant.canConvert<AddressedMessage>()) {
LOG(ERROR) << "ReceivedMessageTransition::eventTest(): "
<< "cannot convert to AddressedMessage...";
return false;
}
const AddressedMessage& message = qVariant.value<AddressedMessage>();
if (message.getMessage().getMessageNumber() == expectedMessageNumber) {
return true;
} else {
LOG(ERROR) << "ReceivedMessageTransition::eventTest(): "
<< "recevied wrong message number: " << message.getMessage().getMessageNumber()
<< ", expected: " << expectedMessageNumber;
return false;
}
}
示例5: 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();
}
示例6: onTransition
void SignalTransition::onTransition(QEvent *event)
{
if (m_signalExpression) {
QStateMachine::SignalEvent *e = static_cast<QStateMachine::SignalEvent*>(event);
m_signalExpression->evaluate(e->arguments());
}
QSignalTransition::onTransition(event);
}
示例7: eventTest
bool MaximizeToFocusTransition::eventTest(QEvent* event)
{
if (!QSignalTransition::eventTest(event))
return false;
QStateMachine::SignalEvent* se = static_cast<QStateMachine::SignalEvent*>(event);
CardWindow* win = se->arguments().at(0).value<CardWindow*>();
CardWindowManager* wm = static_cast<CardWindowManager*>(senderObject());
if (win == wm->activeWindow()) {
// window is already focused
SystemUiController::instance()->setCardWindowMaximized(true);
return false;
}
return true;
}