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

C++ emitError函数代码示例

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

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



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

示例1: resolver

void PlatformDomainNameAddressQuery::runBlocking() {
	//std::cout << "PlatformDomainNameResolver::doRun()" << std::endl;
	boost::asio::ip::tcp::resolver resolver(ioService);
	boost::asio::ip::tcp::resolver::query query(hostname, "5222");
	try {
		//std::cout << "PlatformDomainNameResolver::doRun(): Resolving" << std::endl;
		boost::asio::ip::tcp::resolver::iterator endpointIterator = resolver.resolve(query);
		//std::cout << "PlatformDomainNameResolver::doRun(): Resolved" << std::endl;
		if (endpointIterator == boost::asio::ip::tcp::resolver::iterator()) {
			//std::cout << "PlatformDomainNameResolver::doRun(): Error 1" << std::endl;
			emitError();
		}
		else {
			std::vector<HostAddress> results;
			for ( ; endpointIterator != boost::asio::ip::tcp::resolver::iterator(); ++endpointIterator) {
				boost::asio::ip::address address = (*endpointIterator).endpoint().address();
				results.push_back(address.is_v4() ? HostAddress(&address.to_v4().to_bytes()[0], 4) : HostAddress(&address.to_v6().to_bytes()[0], 16));
			}

			//std::cout << "PlatformDomainNameResolver::doRun(): Success" << std::endl;
			eventLoop->postEvent(
					boost::bind(boost::ref(onResult), results, boost::optional<DomainNameResolveError>()), 
					shared_from_this());
		}
	}
	catch (...) {
		//std::cout << "PlatformDomainNameResolver::doRun(): Error 2" << std::endl;
		emitError();
	}
}
开发者ID:marosi,项目名称:SocialDesktopClient,代码行数:30,代码来源:PlatformDomainNameAddressQuery.cpp


示例2: QObject

SGMXASScanActionControllerFileWriter::SGMXASScanActionControllerFileWriter(const QString &filePath, bool hasRank2Data, QObject *parent) :
	QObject(parent)
{
	filePath_ = filePath;
	hasRank2Data_ = hasRank2Data;

	QFileInfo rank1FileInfo(filePath+".dat");
	if(rank1FileInfo.exists())
		emitError(SGMXASScanActionControllerFileWriter::AlreadyExistsError);

	rank1File_ = new QFile(rank1FileInfo.filePath());
	if(!rank1File_->open(QIODevice::WriteOnly | QIODevice::Text))
		emitError(SGMXASScanActionControllerFileWriter::CouldNotOpenError);
	else
		QTimer::singleShot(0, this, SLOT(emitFileWriterIsBusy()));

	rank2File_ = 0; //NULL
	if(hasRank2Data_){
		QFileInfo rank2FileInfo(filePath+"_spectra.dat");
		if(rank2FileInfo.exists())
			emitError(SGMXASScanActionControllerFileWriter::AlreadyExistsError);

		rank2File_ = new QFile(rank2FileInfo.filePath());
		if(!rank2File_->open(QIODevice::WriteOnly | QIODevice::Text))
			emitError(SGMXASScanActionControllerFileWriter::CouldNotOpenError);
	}
}
开发者ID:Cpppro,项目名称:acquaman,代码行数:27,代码来源:SGMXASScanActionControllerFileWriter.cpp


示例3: emitError

QVariant
QPython::getattr(QVariant obj, QString attr) {
    if (!SINCE_API_VERSION(1, 4)) {
        emitError(QString("Import PyOtherSide 1.4 or newer to use getattr()"));
        return QVariant();
    }

    ENSURE_GIL_STATE;

    PyObjectRef pyobj(convertQVariantToPyObject(obj), true);

    if (!pyobj) {
        emitError(QString("Failed to convert %1 to python object: '%1' (%2)").arg(obj.toString()).arg(priv->formatExc()));
        return QVariant();
    }

    QByteArray byteArray = attr.toUtf8();
    const char *attrStr = byteArray.data();

    PyObjectRef o(PyObject_GetAttrString(pyobj.borrow(), attrStr), true);

    if (!o) {
        emitError(QString("Attribute not found: '%1' (%2)").arg(attr).arg(priv->formatExc()));
        return QVariant();
    }

    return convertPyObjectToQVariant(o.borrow());
}
开发者ID:M4rtinK,项目名称:pyotherside,代码行数:28,代码来源:qpython.cpp


示例4: getScanner

//
//  We need to verify that all of its possible values
//  (in the enum list) 
//   is distinct and
//   refer to valid notations if toValidateNotation is set on
//
void DTDValidator::checkTokenList(const XMLAttDef&  curAttDef
                                ,       bool        toValidateNotation)
{

    XMLCh* list = XMLString::replicate(curAttDef.getEnumeration(), getScanner()->getMemoryManager());
    ArrayJanitor<XMLCh> janList(list, getScanner()->getMemoryManager());

    //
    //  Search forward for a space or a null. If a null,
    //  we are done. If a space, cap it and look it up.
    //
    bool    breakFlag = false;
    XMLCh*  listPtr = list;
    XMLCh*  lastPtr = listPtr;
    while (true)
    {
        while (*listPtr && (*listPtr != chSpace))
            listPtr++;

        //
        //  If at the end, indicate we need to break after
        //  this one. Else, cap it off here.
        //
        if (!*listPtr)
            breakFlag = true;
        else
            *listPtr++ = chNull;

        //distinction check
        //there should be no same token found in the remaining list
        if (XMLString::isInList(lastPtr, listPtr))
        {
            emitError
                (
                XMLValid::AttrDupToken
                , curAttDef.getFullName()
                , lastPtr
                );
        }

        if (toValidateNotation && !fDTDGrammar->getNotationDecl(lastPtr))
        {
            emitError
                (
                XMLValid::UnknownNotRefAttr
                , curAttDef.getFullName()
                , lastPtr
                );
        }

        // Break out if we hit the end last time
        if (breakFlag)
            break;

        // Else move upwards and try again
        lastPtr = listPtr;
    }
}
开发者ID:JohnWilliam1988,项目名称:TCIDE,代码行数:64,代码来源:DTDValidator.cpp


示例5: stopCheck

void f3_launcher::startCheck(QString devPath)
{
    if (stage != 0)
        stopCheck();

    f3_cui_output.clear();
    progress = 0;
    status = f3_launcher_running;
    emit f3_launcher_status_changed(f3_launcher_running);

    this->devPath = devPath;
    QString command;
    QStringList args;
    if (getOption("mode") == "quick")
    {
        command = QString(F3_PROBE_COMMAND);
        if (!probeCommand(command))
        {
            emitError(f3_launcher_no_quick);
            status = f3_launcher_stopped;
            emit f3_launcher_status_changed(f3_launcher_stopped);
            return;
        }
        if (getOption("memory") == "minimum")
            args << QString(F3_OPTION_MIN_MEM);
        if (getOption("destructive") == "true")
            args << QString(F3_OPTION_DESTRUCTIVE);
        args << QString(F3_OPTION_TIME);
        stage = 11;
        emit f3_launcher_status_changed(f3_launcher_staged);
    }
    else
    {
        command = QString(F3_WRITE_COMMAND);
        stage = 1;
        if (getOption("cache") == "write")
        {
            if (probeDiskFull(devPath) && probeCacheFile(devPath))
            {
                command = QString(F3_READ_COMMAND);
                stage = 2;
            }
            else
                emitError(f3_launcher_cache_nofound);
        }
        if (showProgress)
            args << QString(F3_OPTION_SHOW_PROGRESS);
        emit f3_launcher_status_changed(f3_launcher_staged);
    }
    args << devPath;
    f3_cui.start(command, args);

    if (showProgress)
    {
        timer.start();
    }
}
开发者ID:pabloab,项目名称:f3-qt,代码行数:57,代码来源:f3_launcher.cpp


示例6: while

void TrkDevice::tryTrkRead()
{
#ifdef Q_OS_WIN
    const DWORD BUFFERSIZE = 1024;
    char buffer[BUFFERSIZE];
    DWORD charsRead;
    DWORD totalCharsRead = 0;

    while (TryReadFile(d->hdevice, buffer, BUFFERSIZE, &charsRead, NULL)) {
        totalCharsRead += charsRead;
        d->trkReadBuffer.append(buffer, charsRead);
        if (isValidTrkResult(d->trkReadBuffer, d->serialFrame))
            break;
    }
    if (verbose() && totalCharsRead)
        logMessage("Read" + d->trkReadBuffer.toHex());
    if (!totalCharsRead)
        return;
    const ushort len = trk::isValidTrkResult(d->trkReadBuffer, d->serialFrame);
    if (!len) {
        const QString msg = QString::fromLatin1("Partial message: %1").arg(stringFromArray(d->trkReadBuffer));
        emitError(msg);
        return;
    }
#else
    const int size = bytesAvailable(d->file.handle());
    if (!size)
        return;
    const QByteArray data = d->file.read(size);
    if (verbose())
        logMessage("READ " + data.toHex());
    d->trkReadBuffer.append(data);
    const ushort len = trk::isValidTrkResult(d->trkReadBuffer, d->serialFrame);
    if (!len) {
        if (d->trkReadBuffer.size() > 10) {
            const QString msg = QString::fromLatin1("Unable to extract message from '%1' '%2'").
                             arg(QLatin1String(d->trkReadBuffer.toHex())).arg(QString::fromAscii(d->trkReadBuffer));
            emitError(msg);
        }
        return;
    }
#endif // Q_OS_WIN
    trk::TrkResult r;
    QByteArray rawData;
    while (extractResult(&d->trkReadBuffer, d->serialFrame, &r, &rawData)) {
        if (verbose())
            logMessage("Read TrkResult " + r.data.toHex());
        emit messageReceived(r);
        if (!rawData.isEmpty())
            emit rawDataReceived(rawData);
    }
}
开发者ID:TheProjecter,项目名称:project-qtcreator,代码行数:52,代码来源:trkolddevice.cpp


示例7: stubServerListen

bool ConsoleProcess::start(const QString &program, const QString &args)
{
    if (isRunning())
        return false;

    d->m_errorString.clear();
    d->m_error = QProcess::UnknownError;

    QString pcmd;
    QString pargs;
    if (d->m_mode != Run) { // The debugger engines already pre-process the arguments.
        pcmd = program;
        pargs = args;
    } else {
        QtcProcess::Arguments outArgs;
        QtcProcess::prepareCommand(program, args, &pcmd, &outArgs, OsTypeWindows,
                                   &d->m_environment, &d->m_workingDir);
        pargs = outArgs.toWindowsArgs();
    }

    const QString err = stubServerListen();
    if (!err.isEmpty()) {
        emitError(QProcess::FailedToStart, msgCommChannelFailed(err));
        return false;
    }

    QStringList env = d->m_environment.toStringList();
    if (!env.isEmpty()) {
        d->m_tempFile = new QTemporaryFile();
        if (!d->m_tempFile->open()) {
            stubServerShutdown();
            emitError(QProcess::FailedToStart, msgCannotCreateTempFile(d->m_tempFile->errorString()));
            delete d->m_tempFile;
            d->m_tempFile = 0;
            return false;
        }
        QTextStream out(d->m_tempFile);
        out.setCodec("UTF-16LE");
        out.setGenerateByteOrderMark(false);
        foreach (const QString &var, fixWinEnvironment(env))
            out << var << QChar(0);
        out << QChar(0);
        out.flush();
        if (out.status() != QTextStream::Ok) {
            stubServerShutdown();
            emitError(QProcess::FailedToStart, msgCannotWriteTempFile());
            delete d->m_tempFile;
            d->m_tempFile = 0;
            return false;
        }
    }
开发者ID:Gardenya,项目名称:qtcreator,代码行数:51,代码来源:consoleprocess_win.cpp


示例8: fileModified

void ItemEditor::close()
{
    // check if file was modified before closing
    if ( m_modified || fileModified() )
        emit fileModified(m_data, m_mime);

    if (m_editor && m_editor->exitCode() != 0 ) {
        emitError( tr("editor exit code is %1").arg(m_editor->exitCode()) );
        const QByteArray errors = m_editor->readAllStandardError();
        if ( !errors.isEmpty() )
            emitError( QString::fromUtf8(errors) );
    }

    emit closed(this);
}
开发者ID:fade2gray,项目名称:CopyQ,代码行数:15,代码来源:itemeditor.cpp


示例9: qCWarning

void AddCollectionTask::doStart(KIMAP::Session *session)
{
    if (parentCollection().remoteId().isEmpty()) {
        qCWarning(IMAPRESOURCE_LOG) << "Parent collection has no remote id, aborting." << collection().name() << parentCollection().name();
        emitError(i18n("Cannot add IMAP folder '%1' for a non-existing parent folder '%2'.",
                       collection().name(),
                       parentCollection().name()));
        changeProcessed();
        return;
    }

    const QChar separator = separatorCharacter();
    m_pendingJobs = 0;
    m_session = session;
    m_collection = collection();
    m_collection.setName(m_collection.name().replace(separator, QString()));
    m_collection.setRemoteId(separator + m_collection.name());

    QString newMailBox = mailBoxForCollection(parentCollection());

    if (!newMailBox.isEmpty()) {
        newMailBox += separator;
    }

    newMailBox += m_collection.name();

    qCDebug(IMAPRESOURCE_LOG) << "New folder: " << newMailBox;

    KIMAP::CreateJob *job = new KIMAP::CreateJob(session);
    job->setMailBox(newMailBox);

    connect(job, &KIMAP::CreateJob::result, this, &AddCollectionTask::onCreateDone);

    job->start();
}
开发者ID:KDE,项目名称:kdepim-runtime,代码行数:35,代码来源:addcollectiontask.cpp


示例10: sendSpecialPacket

void Transmitter::sendKeyPacket()
{
	char *out;
	int keylen = rsa->getPeerPublicKeyLen();
	try
	{
		if (keylen > 0)
		{
			if (blowfish)
			{
				int len = rsa->encrypt(blowfish->getPass(), blowfish->getPassLen(), &out);
				sendSpecialPacket(out, len, DRTA_INFO_NEW_KEY);
				free(out);
			}
		}
		else
		{
			sendResetPacket();
		}
	}
	catch (Error e)
	{
		emitError(e.getText());
	}
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:25,代码来源:Transmitter.cpp


示例11: Q_ASSERT

void RecognitionControl::run()
{
  Q_ASSERT(recog);

  RecognitionConfiguration *cfg = setupConfig();
  bool success = recog->init(cfg);
  delete cfg;
  if (!success) {
    emitError(i18n("Failed to setup recognition: %1", recog->getLastError()));
    return;
  }

  m_initialized=true;

  while (shouldBeRunning)
  {
    if (!queueLock.tryLock(500)) continue;
    QString file;
    if (!toRecognize.isEmpty())
      file = toRecognize.dequeue();
    queueLock.unlock();
    if (file.isNull()) {
      QThread::msleep(100);
    } else {
      emit recognitionResult(file, recog->recognize(file));
      emit recognitionDone(file);
    }
  }
}
开发者ID:KDE,项目名称:simon,代码行数:29,代码来源:recognitioncontrol.cpp


示例12: PARSER_FLOW_TRACER

    bool Expr::parseUnaryExpression() {
        PARSER_FLOW_TRACER();
        /* left associative */

        switch (ahead().type()) {
        case T_AT_SIGN:
            emitError("addr-of-operator unsupported");
            // ### @foo (addr-of operator)
            return false;

        case T_MINUS:
        case T_PLUS:
        case T_NOT: {
            Model::ExprUnary::Ptr result = new Model::ExprUnary;
            result->setUnaryOperator(tokenToUnary(ahead().type()));
            next();
            FAIL_IF_NOT(parsePrimaryExpression());
            result->setOperand(model());
            setModel(result);
            return true; }

        default:
            return parsePrimaryExpression();
        }
    }
开发者ID:scunz,项目名称:pas2c,代码行数:25,代码来源:Expr.cpp


示例13: cmd

void ListCommand::execute(const QVariantMap options)
{
    DbFilter queryFilter = options.value(OPTION_DB_FILTER).value<DbFilter>();
    CommandFileList cmd(getSession());
    cmd.setAutoDelete(true);
    cmd.setFields("items(fileSize,id,title,modifiedDate,createdDate,downloadUrl, headRevisionId)");
    QString query = QueryEntry::getEntries(queryFilter);

    // Keepass db folder is set to root in Google drive if user did not customize  it
    if (config()->get("cloud/GdriveKeepassFolder").toString().length()
        > 0) cmd.execForFolder(config()->get(
                                   "cloud/GdriveKeepassFolder").toString(), query);
    else cmd.exec(query);
    cmd.waitForFinish(false);
    if (cmd.error() == Errors::NO_ERROR) {
        qRegisterMetaType<GoogleDrive::FileInfoList>("GoogleDrive::FileInfoList");
        qRegisterMetaType<GoogleDrive::FileInfo>("GoogleDrive::FileInfo");
        GoogleDrive::FileInfoList dbList = cmd.files();
        RemoteFileList remoteFileList = RemoteFileImpl::fromGDriveFileInfoList(dbList);
        setResult(KeePassxDriveSync::ResultBuilder().addValue(remoteFileList).build());
        emitSuccess();
    } else {
        emitError(Errors::FileError::LIST_FILES_PROBLEM,
            QString("Failed to list files for keepass directory"));
    }
}
开发者ID:danilovsergei,项目名称:keepassx-gdrive,代码行数:26,代码来源:ListCommand.cpp


示例14: getPlayerIndex

void Server::manageError(QString address, int port, QAbstractSocket::SocketError error){


    int playerIndex = getPlayerIndex(address, port);

    if(networkAnswers[playerIndex].isEmpty()){
        nbNetworkAnswers++;
    }
    else{
        qDebug() << "Server::manageError() : SUPER WEIRD, player sent first message "
                 << networkAnswers[playerIndex] << " then error " <<  error;
    }

    switch(waitingForMessage){
    case(WAITING_FOR_MESSAGE::INFO):
    case(WAITING_FOR_MESSAGE::START):
        emit playerReady(playerIndex, false);
        break;
    case(WAITING_FOR_MESSAGE::PLAY):
        moves[playerIndex] = "";
        break;
    default:
        break;
    }

    if(nbNetworkAnswers == addresses.size()){
        handleTransition();
    }

    emit emitError(playerIndex, error);
}
开发者ID:tstandley,项目名称:DSN4,代码行数:31,代码来源:server.cpp


示例15: Unit

// MEMBER FUNCTION
int Trick::MemoryManager::ref_assignment( REF2* R, V_TREE* V) {

    int ret = 0;
    UCFn *cf = NULL;

    // Create a units conversion function if necessary.
    if (R->units) {
        try {
            Unit *from_units = new Unit(R->units);
            Unit *to_units = new Unit(R->attr->units);
            // This Conversion_to call allocates a new UCFn
            cf = from_units->Conversion_to( to_units);
            delete from_units;
            delete to_units;
        } catch (Unit::CONVERSION_ERROR) {
            std::stringstream message;
            message << "Can't convert \"" << R->units << "\" to \"" << R->attr->units << "\".";
            emitError(message.str());
            cf = NULL;
            return TRICK_UNITS_CONVERSION_ERROR ;
        }
    }

    // R->num_index is badly named. It is really the current dimension
    ret = assign_recursive( R->address, R->attr, R->num_index, 0, V, cf);
    delete cf ;

    return ( ret);

}
开发者ID:Arafatk,项目名称:trick,代码行数:31,代码来源:MemoryManager_ref_assignment.cpp


示例16: pthread_mutex_lock

// MEMBER FUNCTION
void Trick::MemoryManager::clear_var( void* address) {

    ATTRIBUTES* reference_attr;
    ALLOC_INFO* alloc_info;

    pthread_mutex_lock(&mm_mutex);
    alloc_info = get_alloc_info_at( address);
    if (alloc_info != NULL) {
        reference_attr = make_reference_attr( alloc_info);
        if (alloc_info->type == TRICK_STRUCTURED ) {
            if (alloc_info->num_index != 0) {
                clear_arrayed_class( (char*)(alloc_info->start), reference_attr, 0, 0) ;
            } else {
                clear_class( (char*)(alloc_info->start), alloc_info->attr) ;
            }
        } else {
            clear_rvalue( alloc_info->start, reference_attr, 0, 0 );
        }
        free_reference_attr( reference_attr);
    } else {
        std::stringstream message;
        message << "Cannot clear the variable at address " << address
                << "because memory manager knows nothing about it." ;
        emitError(message.str());
    }
    pthread_mutex_unlock(&mm_mutex);
}
开发者ID:lonnell,项目名称:trick,代码行数:28,代码来源:MemoryManager_clear_memory.cpp


示例17: QObject

AMContinuousScanActionControllerAMDSClientDataRequestFileWriter::AMContinuousScanActionControllerAMDSClientDataRequestFileWriter(const QString &filePath, QObject *parent) :
	QObject(parent)
{
	filePath_ = filePath;
	QFileInfo clientDataRequestFileInfo(filePath+".cdr");

	if(clientDataRequestFileInfo.exists())
		emitError(AMScanActionControllerBasicFileWriter::AlreadyExistsError);

	clientDataRequestFile_ = new QFile(clientDataRequestFileInfo.filePath());

	if(!clientDataRequestFile_->open(QIODevice::WriteOnly))
		emitError(AMScanActionControllerBasicFileWriter::CouldNotOpenError);

	else
		QTimer::singleShot(0, this, SLOT(emitFileWriterIsBusy()));
}
开发者ID:acquaman,项目名称:acquaman,代码行数:17,代码来源:AMContinuousScanActionControllerAMDSClientDataRequestFileWriter.cpp


示例18: reexecuteQuery

void AuthorizedCommand::refreshTokenFinished()
{
    CommandRefreshToken* cmd = qobject_cast<CommandRefreshToken*>(sender());
    if (cmd->error() == NoError)
        reexecuteQuery();
    else
        emitError(AuthorizationNeeded, cmd->errorString());
}
开发者ID:danilovsergei,项目名称:keepassx-gdrive,代码行数:8,代码来源:authorized_command.cpp


示例19: emitError

void HttpDownloadWorker::doWork()
{
	if(!mapFile2Memory()) //Ó³ÉäÎļþµ½ÄÚ´æ
	{
		emitError(error());
		return;
	}
	downloadSmallPiece();
}
开发者ID:dreamxstudio,项目名称:webbox,代码行数:9,代码来源:httpdownloadworker.cpp


示例20: mailboxName

bool SQLCache::childMailboxesFresh(const QString &mailbox) const
{
    queryChildMailboxesFresh.bindValue(0, mailboxName(mailbox));
    if (! queryChildMailboxesFresh.exec()) {
        emitError(QObject::tr("Query queryChildMailboxesFresh failed"), queryChildMailboxesFresh);
        return false;
    }
    return queryChildMailboxesFresh.first();
}
开发者ID:KDE,项目名称:trojita,代码行数:9,代码来源:SQLCache.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ emitInt函数代码示例发布时间:2022-05-30
下一篇:
C++ emitDataChanged函数代码示例发布时间: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