本文整理汇总了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);
}
示例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();
}
示例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;
}
示例4: resetState
LongLine::LongLine()
{
image.load("long_line.png");
rect = image.rect();
resetState();
}
示例5: resetState
Paddle::Paddle()
{
image.load("pngs/paddle.png");
rect = image.rect();
resetState();
}
示例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."));
}
示例7: resetState
void LocationInformationWidget::rejectChanges()
{
resetState();
emit stopFilterDiveSite();
emit informationManagementEnded();
emit coordinatesChanged();
}
示例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();
}
示例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();
}
示例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();
}
示例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 <");
}
示例12: setToState
void setToState(const ArrayType& state) {
resetState();
for(size_t i = 0; i < n; ++i) {
if(state[i])
flip(i);
}
}
示例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;
}
示例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();
}
示例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
}