• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ setResult函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: return

HxUniformScalarField3* HxMovingLeastSquaresWarp::createOutputDataSet() {
    HxUniformScalarField3* fromImage =
        dynamic_cast<HxUniformScalarField3*>(portFromImage.getSource());
    HxUniformScalarField3* toImage =
        dynamic_cast<HxUniformScalarField3*>(portToImage.getSource());
    HxUniformScalarField3* warpedImage =
        dynamic_cast<HxUniformScalarField3*>(getResult(0));

    if (!fromImage)
        return (0);

    McDim3l dims;
    McBox3f bbox;

    if (toImage) {
        dims = toImage->lattice().getDims();
        bbox = toImage->getBoundingBox();
    }
    if (!warpedImage || warpedImage->lattice().getDims()[0] != dims[0] ||
        warpedImage->lattice().getDims()[1] != dims[1] ||
        warpedImage->lattice().getDims()[2] != dims[2])
        warpedImage = 0;

    if (!warpedImage) {
        if (toImage->isOfType(HxUniformLabelField3::getClassTypeId())) {
            warpedImage = new HxUniformLabelField3(dims);
            ((HxUniformLabelField3*)warpedImage)->parameters =
                ((HxUniformLabelField3*)fromImage)->parameters;
        } else
            warpedImage =
                new HxUniformScalarField3(dims, fromImage->primType());
    }

    warpedImage->setBoundingBox(bbox);
    warpedImage->composeLabel(fromImage->getLabel(), "Warped");
    setResult(0, warpedImage);
    return (warpedImage);
}
开发者ID:zibamira,项目名称:microtubulestitching,代码行数:38,代码来源:HxMovingLeastSquaresWarp.cpp


示例17: qMax

void YouTubeEnclosureRequest::checkStreams() {
    if (m_streamsRequest->status() == QYouTube::StreamsRequest::Ready) {
        const QVariantList items = m_streamsRequest->result().toList();
        const int start = qMax(0, VIDEO_FORMATS.indexOf(m_settings.value("videoFormat", "22").toString()));
        
        for (int i = start; i < VIDEO_FORMATS.size(); i++) {
            foreach (const QVariant &item, items) {
                const QVariantMap stream = item.toMap();

                if (stream.value("id") == VIDEO_FORMATS.at(i)) {
                    m_result.request = QNetworkRequest(stream.value("url").toString());
                    getVideo();
                    return;
                }
            }
        }

        setErrorString(tr("No video streams found"));
        setResult(Enclosure());
        setStatus(Error);
        emit finished(this);
    }
    else if (m_streamsRequest->status() == QYouTube::StreamsRequest::Failed) {
开发者ID:marxoft,项目名称:cutenews,代码行数:23,代码来源:youtubeenclosurerequest.cpp


示例18: setResult

void CalDialog::waitButton(int axis, bool press, int &lastVal)
{
  JoyDevice::EventType type;
  int number, value;
  bool button = false;
  lastVal = 0;

  setResult(-1);
  // loop until the user presses a button on the device or on the dialog
  do
  {
    qApp->processEvents(QEventLoop::AllEvents, 100);

    if ( joydev->getEvent(type, number, value) )
    {
      button = ( (type == JoyDevice::BUTTON) && (press ? (value == 1) : (value == 0)) );

      if ( (type == JoyDevice::AXIS) && (number == axis) )
        valueLbl->setText(i18n("Value Axis %1: %2", axis+1, lastVal = value));
    }
  }
  while ( !button && (result() == -1) );
}
开发者ID:jschwartzenberg,项目名称:kicker,代码行数:23,代码来源:caldialog.cpp


示例19: _q_onDownloadRedirect

 void _q_onDownloadRedirect() {
     if (!reply) {
         return;
     }
     
     if (reply->error() == QNetworkReply::NoError) {
         QUrl redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString();
         
         if (redirect.isEmpty()) {
             redirect = reply->header(QNetworkRequest::LocationHeader).toString();
         }
         
         if (!redirect.isEmpty()) {
             redirect.setScheme("http");
             QString ext = track.value("original_format").toString();
             formats << Format("original", QString("%1 (%2)").arg(StreamsRequest::tr("Original format")).arg(ext.toUpper()),
                               ext, redirect);
         }
     }
     
     reply->deleteLater();
     reply = 0;
         
     if (track.value("streamable").toBool()) {
         getRedirect(track.value("stream_url").toString(), SLOT(_q_onStreamRedirect()));
     }
     else {
         Q_Q(StreamsRequest);
         
         setResult(formats);
         setStatus(Request::Ready);
         setError(Request::NoError);
         setErrorString(QString());
         
         emit q->finished();
     }
 }
开发者ID:lukedirtwalker,项目名称:qsoundcloud,代码行数:37,代码来源:streamsrequest.cpp


示例20: create_tempfile

void ImportTextDialog::convertTextFile() {
    int import_file_fd;
    char *tmpname;
    int err;

    capfile_name_.clear();
    /* Choose a random name for the temporary import buffer */
    import_file_fd = create_tempfile(&tmpname, "import");
    capfile_name_.append(tmpname);

    import_info_.wdh = wtap_dump_fdopen(import_file_fd, WTAP_FILE_TYPE_SUBTYPE_PCAP, import_info_.encapsulation, import_info_.max_frame_length, FALSE, &err);
    qDebug() << capfile_name_ << ":" << import_info_.wdh << import_info_.encapsulation << import_info_.max_frame_length;
    if (import_info_.wdh == NULL) {
        open_failure_alert_box(capfile_name_.toUtf8().constData(), err, TRUE);
        fclose(import_info_.import_text_file);
        setResult(QDialog::Rejected);
        return;
    }

    text_import_setup(&import_info_);

    text_importin = import_info_.import_text_file;

    text_importlex();

    text_import_cleanup();

    if (fclose(import_info_.import_text_file))
    {
        read_failure_alert_box(import_info_.import_text_filename, errno);
    }

    if (!wtap_dump_close(import_info_.wdh, &err))
    {
        write_failure_alert_box(capfile_name_.toUtf8().constData(), err);
    }
}
开发者ID:pvons,项目名称:wireshark,代码行数:37,代码来源:import_text_dialog.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setRight函数代码示例发布时间:2022-05-30
下一篇:
C++ setRestartRequired函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap