Exemple #1
0
//! [4]
void App::processInvokeReply() {
    // Get the reply from the sender object
    InvokeReply *reply = qobject_cast<InvokeReply*>(sender());

    // Check for errors during invocation
    switch (reply->error()) {
    case InvokeReplyError::BadRequest:
        m_errorMessage = tr("[ErrorBadRequest] Invoke Failed!");
        showErrorDialog();
        break;
    case InvokeReplyError::Internal:
        m_errorMessage = tr("[ErrorInternal] Invoke Failed!");
        showErrorDialog();
        break;
    case InvokeReplyError::NoTarget:
        m_errorMessage = tr("[ErrorNoTarget] Invoke Failed!");
        showErrorDialog();
        break;
    case InvokeReplyError::TargetNotOwned:
        m_errorMessage = tr("[ErrorTargetNotOwned] Invoke Failed.");
        showErrorDialog();
        break;
    default:
        break;
    }

    // Delete the reply later on
    reply->deleteLater();
}
void ApplicationUI::processInvokeReply()
{
	qDebug() << "FMI ######### processInvokeReply";
	InvokeReply *reply = qobject_cast<InvokeReply*>(sender());

	// Check for errors during invocation

	switch (reply->error()) {
	case InvokeReplyError::BadRequest:
		qDebug() << "FMI ##### fehler? "<< tr("[ErrorBadRequest] Invoke Failed!");
		break;
	case InvokeReplyError::Internal:
		qDebug() << "FMI ##### fehler? "<< tr("[ErrorInternal] Invoke Failed!");
		break;
	case InvokeReplyError::NoTarget:
		qDebug() << "FMI ##### fehler? "<< tr("[ErrorNoTarget] Invoke Failed!");
		break;
	case InvokeReplyError::TargetNotOwned:
		qDebug() << "FMI ##### fehler? "<< tr("[ErrorTargetNotOwned] Invoke Failed.");
		break;
	default:
		qDebug() << "FMI ##### kein fehler ";
		break;
	}

	// Delete the reply later on
	reply->deleteLater();
}