当前位置: 首页>>代码示例>>C++>>正文


C++ setResult函数代码示例

本文整理汇总了C++中setResult函数的典型用法代码示例。如果您正苦于以下问题:C++ setResult函数的具体用法?C++ setResult怎么用?C++ setResult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setResult函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

void RivenOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
	switch (cmd) {
	case GUI::kOKCmd:
		_vm->_vars["azip"] = _zipModeCheckbox->getState() ? 1 : 0;
		_vm->_vars["waterenabled"] = _waterEffectCheckbox->getState() ? 1 : 0;
		_vm->_vars["transitionmode"] = _transitionModePopUp->getSelectedTag();
		setResult(1);
		close();
		break;
	case kQuitCmd: {
		Common::Event eventQ;
		eventQ.type = Common::EVENT_QUIT;
		g_system->getEventManager()->pushEvent(eventQ);
		close();
		break;
	}
	default:
		MohawkOptionsDialog::handleCommand(sender, cmd, data);
	}
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:20,代码来源:dialogs.cpp

示例2: filelist_alloc

void MxfWriter::run()
{
    int i = 0;

    opendcpMxf->mxf.frame_done.callback = MxfWriter::frameDoneCb;
    opendcpMxf->mxf.frame_done.argument = this;

    filelist_t *fileList = filelist_alloc(mxfFileList.size());

    while (!mxfFileList.isEmpty()) {
        sprintf(fileList->files[i++],"%s",mxfFileList.takeFirst().absoluteFilePath().toUtf8().data());
    }

    rc = write_mxf(opendcpMxf, fileList, mxfOutputFile.toUtf8().data());

    filelist_free(fileList);

    emit setResult(rc);
    emit finished();
}
开发者ID:cbsrobot,项目名称:OpenDCP,代码行数:20,代码来源:mxfWriter.cpp

示例3: log

bool LatencyTask::requestComplete(HttpClientConnection *conn) {
    auto p = current_request.find(conn->contents());
    if (p == current_request.end()) {
        log() << "unexpected response: " << conn->contents();
    } else {
        double latency = secondsSince(p->second);
        log() << "got " << conn->contents() << " after " << latency << " sec";
        samples.push_back(latency);
    }

    if (samples.size() < 12)
        return true;

    if (!terminated()) {
        log() << "Samples: " << json11::Json(samples).dump();
        setResult(calculateLatency(samples));
    }

    return false;
}
开发者ID:dotse,项目名称:bbk,代码行数:20,代码来源:latencytask.cpp

示例4: toupper

void Dialog::handleKeyDown(Common::KeyState state) {
	if (_focusedWidget) {
		if (_focusedWidget->handleKeyDown(state))
			return;
	}

	// Hotkey handling
	if (state.ascii != 0) {
		Widget *w = _firstWidget;
		state.ascii = toupper(state.ascii);
		while (w) {
			if (w->_type == kButtonWidget && state.ascii == toupper(((ButtonWidget *)w)->_hotkey)) {
				// The hotkey for widget w was pressed. We fake a mouse click into the
				// button by invoking the appropriate methods.
				w->handleMouseDown(0, 0, 1, 1);
				w->handleMouseUp(0, 0, 1, 1);
				return;
			}
			w = w->_next;
		}
	}

	// ESC closes all dialogs by default
	if (state.keycode == Common::KEYCODE_ESCAPE) {
		setResult(-1);
		close();
	}

	if (state.keycode == Common::KEYCODE_TAB) {
		// TODO: Maybe add Tab behaviours for all widgets too.
		// searches through widgets on screen for tab widget
		Widget *w = _firstWidget;
		while (w) {
			if (w->_type == kTabWidget)
				if (w->handleKeyDown(state))
					return;

			w = w->_next;
		}
	}
}
开发者ID:86400,项目名称:scummvm,代码行数:41,代码来源:dialog.cpp

示例5: testAttribute

int GtkFileDialog::exec() {
    d->setModality(windowModality());

    bool deleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
    setAttribute(Qt::WA_DeleteOnClose, false);

    bool wasShowModal = testAttribute(Qt::WA_ShowModal);
    setAttribute(Qt::WA_ShowModal, true);
    setResult(0);

    show();

    QPointer<QDialog> guard = this;
    d->exec();
    if (guard.isNull())
        return QDialog::Rejected;

    setAttribute(Qt::WA_ShowModal, wasShowModal);

    return result();
}
开发者ID:2asoft,项目名称:tdesktop,代码行数:21,代码来源:file_dialog_linux.cpp

示例6: switch

//---------------------------------------------------------------------------------------------------------------------
void ConfigDialog::Apply()
{
    switch (contentsWidget->currentRow())
    {
        case (0):
            configurationPage->Apply();
            break;
        case (1):
            patternPage->Apply();
            break;
        case (2):
            communityPage->Apply();
            break;
        case (3):
            pathPage->Apply();
            break;
        default:
            break;
    }
    setResult(QDialog::Accepted);
}
开发者ID:a-dilla,项目名称:Valentina,代码行数:22,代码来源:configdialog.cpp

示例7: undoModifyPoly

MStatus tm_polySlot::undoIt()
//
//	Description:
//		implements undo for the MEL tm_polySlot command.  
//
//		This method is called to undo a previous command of this type.  The 
//		system should be returned to the exact state that it was it previous 
//		to this command being executed.  That includes the selection state.
//
//	Return Value:
//		MS::kSuccess - command succeeded
//		MS::kFailure - redoIt failed.  this is a serious problem that will
//                     likely cause the undo queue to be purged
//
{
	MStatus status;
	status = undoModifyPoly();
	if( !status) setResult( "tm_polySlot undo failed!" );
	MGlobal::setActiveSelectionList( oldSelList);
 	return status;
}
开发者ID:AlbertR,项目名称:cgru170,代码行数:21,代码来源:polySlotCmd.cpp

示例8: tvAssertCell

void c_GenMapWaitHandle::onUnblocked() {
  for (;
       m_deps->iter_valid(m_iterPos);
       m_iterPos = m_deps->iter_next(m_iterPos)) {

    Cell* current = tvAssertCell(m_deps->iter_value(m_iterPos));
    assert(current->m_type == KindOfObject);
    assert(current->m_data.pobj->instanceof(c_WaitHandle::classof()));
    auto child = static_cast<c_WaitHandle*>(current->m_data.pobj);

    if (child->isSucceeded()) {
      cellSet(child->getResult(), *current);
    } else if (child->isFailed()) {
      putException(m_exception, child->getException());
    } else {
      assert(child->instanceof(c_WaitHandle::classof()));
      auto child_wh = static_cast<c_WaitableWaitHandle*>(child);

      try {
        if (isInContext()) {
          child_wh->enterContext(getContextIdx());
        }
        detectCycle(child_wh);
        blockOn(child_wh);
        return;
      } catch (const Object& cycle_exception) {
        putException(m_exception, cycle_exception.get());
      }
    }
  }

  if (m_exception.isNull()) {
    setResult(make_tv<KindOfObject>(m_deps.get()));
    m_deps = nullptr;
  } else {
    setException(m_exception.get());
    m_exception = nullptr;
    m_deps = nullptr;
  }
}
开发者ID:Bluarggag,项目名称:hhvm,代码行数:40,代码来源:gen_map_wait_handle.cpp

示例9: clearResult

MStatus tm_polyExtract::doIt( const MArgList& args )
{
	MStatus stat = MS::kSuccess;
	clearResult();

	MArgDatabase argData( syntax(), args);

//	if(argData.isFlagSet( extractFaces_Flag))
	{
		MSelectionList selectionList;
		argData.getObjects( selectionList);
		MStringArray node_names;
		bool result = extractFaces_Func( selectionList, node_names);
		if(!result)
		{
			MGlobal::displayError("tm_polyExtract: extractFaces function call failed.");
			return MStatus::kFailure;
		}
		setResult( node_names);
		return stat;
	}
}
开发者ID:AlbertR,项目名称:cgru170,代码行数:22,代码来源:polyExtract.cpp

示例10: ASSERT

void IDBOpenDBRequest::onUpgradeNeeded(const IDBResultData& resultData)
{
    ASSERT(currentThread() == originThreadID());

    Ref<IDBDatabase> database = IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData);
    Ref<IDBTransaction> transaction = database->startVersionChangeTransaction(resultData.transactionInfo(), *this);

    ASSERT(transaction->info().mode() == IndexedDB::TransactionMode::VersionChange);
    ASSERT(transaction->originalDatabaseInfo());

    uint64_t oldVersion = transaction->originalDatabaseInfo()->version();
    uint64_t newVersion = transaction->info().newVersion();

    LOG(IndexedDB, "IDBOpenDBRequest::onUpgradeNeeded() - current version is %" PRIu64 ", new is %" PRIu64, oldVersion, newVersion);

    setResult(WTFMove(database));
    m_isDone = true;
    m_transaction = WTFMove(transaction);
    m_transaction->addRequest(*this);

    enqueueEvent(IDBVersionChangeEvent::create(oldVersion, newVersion, eventNames().upgradeneededEvent));
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:22,代码来源:IDBOpenDBRequest.cpp

示例11: setErrorString

bool YouTubeEnclosureRequest::getEnclosure(const QString &url, const QVariantMap &settings) {
    if (status() == Active) {
        return false;
    }

    const QString videoId = url.section(QRegExp("v=|list=|/"), -1).section(QRegExp("&|\\?"), 0, 0);
    
    
    if (videoId.isEmpty()) {
        setErrorString(tr("Cannot extract video ID from URL"));
        setResult(Enclosure());
        setStatus(Error);
        emit finished(this);
        return false;
    }

    m_settings = settings;
    m_settings["videoId"] = videoId;
    setStatus(Active);
    getStreams();
    return true;
}
开发者ID:marxoft,项目名称:cutenews,代码行数:22,代码来源:youtubeenclosurerequest.cpp

示例12: SIGNAL

// --------------------------------------------------------------------------
QList<QVariantMap> qMidasAPI::synchronousQuery(
  bool &ok,
  const QString& midasUrl,const QString& method,
  const ParametersType& parameters,
  int maxWaitingTimeInMSecs)
{
  qMidasAPI midasAPI;
  midasAPI.setMidasUrl(midasUrl);
  midasAPI.setTimeOut(maxWaitingTimeInMSecs);
  midasAPI.query(method, parameters);
  qMidasAPIResult queryResult;
  QObject::connect(&midasAPI, SIGNAL(resultReceived(QUuid,QList<QVariantMap>)),
                   &queryResult, SLOT(setResult(QUuid,QList<QVariantMap>)));
  QObject::connect(&midasAPI, SIGNAL(errorReceived(QString)),
                   &queryResult, SLOT(setError(QString)));
  QEventLoop eventLoop;
  QObject::connect(&midasAPI, SIGNAL(resultReceived(QUuid,QList<QVariantMap>)),
                   &eventLoop, SLOT(quit()));
  // Time out will fire an error which will quit the event loop.
  QObject::connect(&midasAPI, SIGNAL(errorReceived(QString)),
                   &eventLoop, SLOT(quit()));
  eventLoop.exec();
  ok = queryResult.Error.isNull();
  if (!ok)
    {
    QVariantMap map;
    map["queryError"] = queryResult.Error;
    queryResult.Result.push_front(map);
    }
  if (queryResult.Result.count() == 0)
    {
    // \tbd
    Q_ASSERT(queryResult.Result.count());
    QVariantMap map;
    map["queryError"] = tr("Unknown error");
    queryResult.Result.push_front(map);
    }
  return queryResult.Result;
}
开发者ID:Slicer,项目名称:qMidasAPI,代码行数:40,代码来源:qMidasAPI.cpp

示例13: params

void SearchController::statusAction()
{
    const int id = params()["id"].toInt();

    const auto searchHandlers = sessionManager()->session()->getData<SearchHandlerDict>(SEARCH_HANDLERS);
    if ((id != 0) && !searchHandlers.contains(id))
        throw APIError(APIErrorType::NotFound);

    QJsonArray statusArray;
    const QList<int> searchIds {(id == 0) ? searchHandlers.keys() : QList<int> {id}};

    for (const int searchId : searchIds) {
        const SearchHandlerPtr searchHandler = searchHandlers[searchId];
        statusArray << QJsonObject {
            {"id", searchId},
            {"status", searchHandler->isActive() ? "Running" : "Stopped"},
            {"total", searchHandler->results().size()}
        };
    }

    setResult(statusArray);
}
开发者ID:elFarto,项目名称:qBittorrent,代码行数:22,代码来源:searchcontroller.cpp

示例14: SHBrowseForFolder

MStatus CMayaGetFolder::doIt( const MArgList &args )
{
	BROWSEINFO browseInfo = 
	{
		NULL,
		NULL,
		NULL,
		"Select folder",
		NULL,
		NULL,
		NULL
	};
	LPITEMIDLIST itemList = SHBrowseForFolder(&browseInfo);	
	if(itemList)
	{
		char folder[MAX_PATH];
		SHGetPathFromIDList(itemList, folder);
		setResult(folder);
	}

	return MStatus::kSuccess;
}
开发者ID:CobaltBlues,项目名称:MultiversePlatform,代码行数:22,代码来源:MayaGetFolder.cpp

示例15: setResult

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
MStatus CVstSelectCoincidentFacesCmd::redoIt()
{
	MStatus mStatus;

	if ( !mStatus )
	{
		setResult( MString( "Cannot parse command line" ) + mStatus.errorString() );
		return MS::kFailure;
	}

	const MArgDatabase &mArgDatabase( m_undo.ArgDatabase() );

	m_undo.SaveCurrentSelection();

	if ( mArgDatabase.isFlagSet( kOptHelp ) )
	{
		GetSyntaxHelp()->PrintHelp( GetName(), GetDesc() );
		return MS::kSuccess;
	}

	return DoSelect();
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:25,代码来源:VstSelectCoincidentFacesCmd.cpp


注:本文中的setResult函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。