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


C++ resetState函数代码示例

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


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

示例1: m_dbPath

MixClient::MixClient(std::string const& _dbPath):
	m_dbPath(_dbPath), m_miningThreads(0)
{
	std::map<Secret, u256> account;
	account.insert(std::make_pair(c_defaultUserAccountSecret, 1000000 * ether));
	resetState(account);
}
开发者ID:gluk256,项目名称:cpp-ethereum,代码行数:7,代码来源:MixClient.cpp

示例2: resetState

Enemy::Enemy()
{

  xdir = 1;
  ydir = -1;
 xdir2 = -1;
  ydir2 = 1;
 xdir3 = 1;
  ydir3 = 1;
 xdir4 = -1;
  ydir4 = -1;
 xdir5 = -1;
  ydir5 = 1;
 xdir6 = 1;
  ydir6 = 1;
  image.load("enemy.png");
  image = image.scaled(30,30,Qt::IgnoreAspectRatio,Qt::FastTransformation);
  rect = image.rect();
  rect2 = image.rect();
  rect3 = image.rect();
  rect4 = image.rect();
  rect5 = image.rect();
  rect6 = image.rect();
  resetState();

}
开发者ID:tianboli,项目名称:Shooting,代码行数:26,代码来源:enemy.cpp

示例3: printf

bool QPinyinImpl::commit_selection(int k)
{
        bool bUpdate = false;
        unsigned int index = ((k-'0')+9)%10;

        if(index<m_pinyin_frame->m_ime_info.candidates_on_page){
                m_pinyin_frame->m_engine.hit(m_pinyin_frame->m_ime_info.first_visible+index);
                if(m_pinyin_frame->m_engine.isPhrase()){
                        QString phrase=m_pinyin_frame->get_phrase(m_pinyin_frame->m_ime_info.first_visible+index);
                        if(m_pinyin_frame->m_bMakingPhrase){
                                m_pinyin_frame->m_ime_info.phrase+=phrase;
                        }
                        else{
                                printf("phrase unicode:");
                                for(int i=0;i<phrase.length();i++){
                                        printf("%04X,",phrase[i].unicode());
                                        SendKey(phrase[i].unicode());
                                }
                                printf("\n");
                        }
                }
                else{
                        if(m_pinyin_frame->m_bMakingPhrase){
                                m_pinyin_frame->m_ime_info.phrase+=m_pinyin_frame->get_char(m_pinyin_frame->m_ime_info.first_visible+index);
                        }
                        else{
                                SendKey(m_pinyin_frame->get_charunicode(index));

                        }
                }
                resetState();
                bUpdate=true;
        }
        return bUpdate;
}
开发者ID:qingwu,项目名称:nantong,代码行数:35,代码来源:PinyinImpl.cpp

示例4: resetState

LongLine::LongLine()
{
image.load("long_line.png");

  rect = image.rect();
  resetState();
}
开发者ID:sonjacwy,项目名称:Catch-the-Factors,代码行数:7,代码来源:longline.cpp

示例5: resetState

Paddle::Paddle()
{
  	image.load("pngs/paddle.png");

  	rect = image.rect();
  	resetState();
}
开发者ID:kernelhcy,项目名称:hcyprojects,代码行数:7,代码来源:paddle.cpp

示例6: slotStatusMsg

void ndManager::slotNewFile(){
    slotStatusMsg(tr("Initializing new file..."));
    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));

    //If no document is open already, create a new parameter file.
    if(!mainDock){
        newFile = true;
        int returnStatus = doc->newDocument();
        if(returnStatus == ndManagerDoc::PARSE_ERROR){
            QApplication::restoreOverrideCursor();
            QMessageBox::critical (this, tr("Error!"),tr("The new parameter file could not be initialize due to parsing error."));
            resetState();
            return;
        }

        const QString url = QDir::currentPath()+QDir::separator() + "Untitled";
        doc->rename(url);
        filePath = url;
        setWindowTitle(url);
    }
    //Open a new instance of the application.
    else{
        QProcess::startDetached("ndmanager");
    }
    QApplication::restoreOverrideCursor();
    slotStatusMsg(tr("Ready."));
}
开发者ID:CleitonAguiar,项目名称:ndmanager,代码行数:27,代码来源:ndmanager.cpp

示例7: resetState

void LocationInformationWidget::rejectChanges()
{
	resetState();
	emit stopFilterDiveSite();
	emit informationManagementEnded();
	emit coordinatesChanged();
}
开发者ID:superscud,项目名称:subsurface,代码行数:7,代码来源:locationinformation.cpp

示例8: startClient

    virtual void startClient(const QStringList &mechlist, bool allowClientSendFirst) {
        Q_UNUSED(allowClientSendFirst);

        mechanism_ = QString();
        foreach(QString mech, mechlist) {
            if (mech == "DIGEST-MD5") {
                mechanism_ = "DIGEST-MD5";
                break;
            }
#ifdef SIMPLESASL_PLAIN
            if (mech == "PLAIN" && allow_plain)
                mechanism_ = "PLAIN";
#endif
        }

        if(!capable || mechanism_.isEmpty()) {
            authCondition_ = QCA::SASL::NoMechanism;
            result_ = Error;
            if (!capable)
                qWarning("simplesasl.cpp: Not enough capabilities");
            if (mechanism_.isEmpty())
                qWarning("simplesasl.cpp: No mechanism available");
            QMetaObject::invokeMethod(this, "resultsReady", Qt::QueuedConnection);
            return;
        }

        resetState();
        result_ = Continue;
        step = 0;
        tryAgain();
    }
开发者ID:BackupTheBerlios,项目名称:synapse-xmpp-svn,代码行数:31,代码来源:simplesasl.cpp

示例9: stopFilterDiveSite

void LocationInformationWidget::acceptChanges()
{
	emit stopFilterDiveSite();
	char *uiString;
	struct dive_site *currentDs = get_dive_site_by_uuid(displayed_dive_site.uuid);
	currentDs->latitude = displayed_dive_site.latitude;
	currentDs->longitude = displayed_dive_site.longitude;
	uiString = ui.diveSiteName->text().toUtf8().data();
	if (!same_string(uiString, currentDs->name)) {
		free(currentDs->name);
		currentDs->name = copy_string(uiString);
	}
	uiString = ui.diveSiteDescription->text().toUtf8().data();
	if (!same_string(uiString, currentDs->description)) {
		free(currentDs->description);
		currentDs->description = copy_string(uiString);
	}
	uiString = ui.diveSiteNotes->document()->toPlainText().toUtf8().data();
	if (!same_string(uiString, currentDs->notes)) {
		free(currentDs->notes);
		currentDs->notes = copy_string(uiString);
	}
	if (dive_site_is_empty(currentDs)) {
		LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));
		displayed_dive.dive_site_uuid = 0;
	}

	mark_divelist_changed(true);
	resetState();
	emit informationManagementEnded();
	emit coordinatesChanged();
}
开发者ID:superscud,项目名称:subsurface,代码行数:32,代码来源:locationinformation.cpp

示例10: free

void LocationInformationWidget::acceptChanges()
{
	char *uiString;
	currentDs->latitude = displayed_dive_site.latitude;
	currentDs->longitude = displayed_dive_site.longitude;
	uiString = ui.diveSiteName->text().toUtf8().data();
	if (!same_string(uiString, currentDs->name)) {
		free(currentDs->name);
		currentDs->name = copy_string(uiString);
	}
	uiString = ui.diveSiteDescription->text().toUtf8().data();
	if (!same_string(uiString, currentDs->description)) {
		free(currentDs->description);
		currentDs->description = copy_string(uiString);
	}
	uiString = ui.diveSiteNotes->document()->toPlainText().toUtf8().data();
	if (!same_string(uiString, currentDs->notes)) {
		free(currentDs->notes);
		currentDs->notes = copy_string(uiString);
	}
	if (dive_site_is_empty(currentDs)) {
		delete_dive_site(currentDs->uuid);
		displayed_dive.dive_site_uuid = 0;
		setLocationId(0);
	} else {
		setLocationId(currentDs->uuid);
	}
	mark_divelist_changed(true);
	resetState();
	emit informationManagementEnded();
	emit coordinatesChanged();
}
开发者ID:AddictXQ,项目名称:subsurface,代码行数:32,代码来源:locationinformation.cpp

示例11: qDebug

//-----------------------------------------------------------------------------
// SatAppToneProvider::playTone
//-----------------------------------------------------------------------------
void SatAppToneProvider::playTone(SatAppAction& action)
{
    qDebug("SATAPP: SatAppToneProvider::playTone >");
    resetState();
    
    mCurrentAction = &action;
    int tone = action.value(KeyToneId).toInt();
    int duration = action.value(KeyDuration).toInt();
    QString text = action.value(KeyText).toString();
    QByteArray sequence;
    mState = recognizeTone(tone,sequence,duration);
    if (mState == PlayStandardTone)
    {
        playStandardTone(text,sequence,duration);
    }
    else if (mState == PlayUserSelectedTone)
    {
        playUserSelectedTone(text,tone,duration);
    }
    else
    {
        mCurrentAction->complete(ESatCmdDataNotUnderstood);
        mCurrentAction = 0;
    }
    qDebug("SATAPP: SatAppToneProvider::playTone <");
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:29,代码来源:satapptoneprovider.cpp

示例12: setToState

  void setToState(const ArrayType& state) {
    resetState();
    for(size_t i = 0; i < n; ++i) {
      if(state[i])
	flip(i);
    }
  }
开发者ID:hoytak,项目名称:latticeflow,代码行数:7,代码来源:tracking.hpp

示例13: check_curl_code

U32 LLCurl::Easy::report(CURLcode code)
{
	U32 responseCode = 0;	
	std::string responseReason;
	
	if (code == CURLE_OK)
	{
		check_curl_code(curl_easy_getinfo(mCurlEasyHandle, CURLINFO_RESPONSE_CODE, &responseCode));
		//*TODO: get reason from first line of mHeaderOutput
	}
	else
	{
		responseCode = 499;
		responseReason = strerror(code) + " : " + mErrorBuffer;
		setopt(CURLOPT_FRESH_CONNECT, TRUE);
	}

	if (mResponder)
	{	
		mResponder->completedRaw(responseCode, responseReason, mChannels, mOutput);
		mResponder = NULL;
	}
	
	resetState();
	return responseCode;
}
开发者ID:OS-Development,项目名称:VW.Zen,代码行数:26,代码来源:llcurl.cpp

示例14: account

void JabberEditAccountWidget::apply()
{
	AccountDetails = dynamic_cast<JabberAccountDetails *>(account().details());
	if (!AccountDetails)
		return;

	account().setAccountIdentity(Identities->currentIdentity());
	account().setId(AccountId->text());
	account().setRememberPassword(RememberPassword->isChecked());
	account().setPassword(AccountPassword->text());
	account().setHasPassword(!AccountPassword->text().isEmpty());
	AccountDetails->setUseCustomHostPort(CustomHostPort->isChecked());
	AccountDetails->setCustomHost(CustomHost->text());
	AccountDetails->setCustomPort(CustomPort->text().toInt());
	AccountDetails->setEncryptionMode((JabberAccountDetails::EncryptionFlag)EncryptionMode->itemData(EncryptionMode->currentIndex()).toInt());
	AccountDetails->setPlainAuthMode((JabberAccountDetails::AllowPlainType)PlainTextAuth->itemData(PlainTextAuth->currentIndex()).toInt());
	AccountDetails->setLegacySSLProbe(LegacySSLProbe->isChecked());
	AccountDetails->setAutoResource(AutoResource->isChecked());
	AccountDetails->setResource(ResourceName->text());
	AccountDetails->setPriority(Priority->text().toInt());
	AccountDetails->setDataTransferProxy(DataTransferProxy->text());
	AccountDetails->setSendGoneNotification(SendGoneNotification->isChecked());
	AccountDetails->setSendTypingNotification(SendTypingNotification->isChecked());
	Proxy->apply();

	if (PersonalInfoWidget->isModified())
		PersonalInfoWidget->apply();

	IdentityManager::instance()->removeUnused();
	ConfigurationManager::instance()->flush();

	resetState();
}
开发者ID:partition,项目名称:kadu,代码行数:33,代码来源:jabber-edit-account-widget.cpp

示例15: Q_Q

void QKeySequenceEditPrivate::init()
{
    Q_Q(QKeySequenceEdit);

    lineEdit = new QLineEdit(q);
    lineEdit->setObjectName(QStringLiteral("qt_keysequenceedit_lineedit"));
    keyNum = 0;
    prevKey = -1;
    releaseTimer = 0;

    QVBoxLayout *layout = new QVBoxLayout(q);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->addWidget(lineEdit);

    key[0] = key[1] = key[2] = key[3] = 0;

    lineEdit->setFocusProxy(q);
    lineEdit->installEventFilter(q);
    resetState();

    q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    q->setFocusPolicy(Qt::StrongFocus);
    q->setAttribute(Qt::WA_MacShowFocusRect, true);
    q->setAttribute(Qt::WA_InputMethodEnabled, false);

    // TODO: add clear button
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:27,代码来源:qkeysequenceedit.cpp


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