本文整理汇总了C++中resetState函数的典型用法代码示例。如果您正苦于以下问题:C++ resetState函数的具体用法?C++ resetState怎么用?C++ resetState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resetState函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: main
int main(){
signal(SIGINT, intHandle);
signal(SIGPIPE, SIG_IGN);
while(1){
initClientSocket(&hints, &res, P2host, P12port, &sfd);
connectClientSocket(res, &sfd, 5);
fprintf(stderr, "Connected to P2\n");
while(1){
int64_t n = rand() % 1024;
int64_t sign = rand() % 2 ? -1 : 1;
n *= sign;
printf("%"PRId64"\n", n);
//It's 2014 and there's no standard hton64? Am I missing something?
int64_t data = htobe64(n);
conStat = send(sfd, (void*)&data, sizeof(int64_t), 0);
if(conStat <= 0){
fprintf(stderr, "Error sending data (%d): %s\n", errno, strerror(errno));
resetState();
break;
}
usleep(250000);
}
}
return 0;
}
开发者ID:bob2827,项目名称:ps-pulsecheck,代码行数:27,代码来源:p1.c
示例17: resetState
bool OrientationFilter::init(const OrientationFilterConstants &constants)
{
resetState();
m_constants= constants;
return true;
}
开发者ID:cboulay,项目名称:PSMoveService,代码行数:7,代码来源:OrientationFilter.cpp
示例18: e
void Spacecraft::initStateVector(Vector<double> rv, Vector<double> dp)
{
// first the size of input vector should be checked
if(rv.size()!=6)
{
Exception e("Error in Spacecraft::initStateVector(): the size of rv should be 6.");
GPSTK_THROW(e);
}
resetState();
// set position
r(0) = rv(0);
r(1) = rv(1);
r(2) = rv(2);
// set velocity
v(0) = rv(3);
v(1) = rv(4);
v(2) = rv(5);
// set force model parameters
p = dp;
// set dr_dp0 and dv_dp0
const int np = p.size();
dr_dp0.resize(3*np,0.0);
dv_dp0.resize(3*np,0.0);
} // End of method 'Spacecraft::initStateVector()'
开发者ID:xiangyan66,项目名称:GPSTk,代码行数:31,代码来源:Spacecraft.cpp
示例19: resetState
void LLCurl::Easy::prepRequest(const std::string& url,
const std::vector<std::string>& headers,
ResponderPtr responder, bool post)
{
resetState();
if (post) setoptString(CURLOPT_ENCODING, "");
// setopt(CURLOPT_VERBOSE, 1); // usefull for debugging
setopt(CURLOPT_NOSIGNAL, 1);
if (LLSocks::getInstance()->isHttpProxyEnabled())
{
std::string address = LLSocks::getInstance()->getHTTPProxy().getIPString();
U16 port = LLSocks::getInstance()->getHTTPProxy().getPort();
setoptString(CURLOPT_PROXY, address.c_str());
setopt(CURLOPT_PROXYPORT, port);
if (LLSocks::getInstance()->getHttpProxyType() == LLPROXY_SOCKS)
{
setopt(CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
}
else
{
setopt(CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
}
}
mOutput.reset(new LLBufferArray);
setopt(CURLOPT_WRITEFUNCTION, (void*)&curlWriteCallback);
setopt(CURLOPT_WRITEDATA, (void*)this);
setopt(CURLOPT_READFUNCTION, (void*)&curlReadCallback);
setopt(CURLOPT_READDATA, (void*)this);
setopt(CURLOPT_HEADERFUNCTION, (void*)&curlHeaderCallback);
setopt(CURLOPT_HEADERDATA, (void*)this);
setErrorBuffer();
setCA();
setopt(CURLOPT_SSL_VERIFYPEER, true);
setopt(CURLOPT_TIMEOUT, CURL_REQUEST_TIMEOUT);
setoptString(CURLOPT_URL, url);
mResponder = responder;
if (!post)
{
slist_append("Connection: keep-alive");
slist_append("Keep-alive: 300");
// Accept and other headers
for (std::vector<std::string>::const_iterator iter = headers.begin();
iter != headers.end(); ++iter)
{
slist_append((*iter).c_str());
}
}
}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:59,代码来源:llcurl.cpp
示例20: Q_Q
void QKeySequenceEditPrivate::finishEditing()
{
Q_Q(QKeySequenceEdit);
resetState();
emit q->keySequenceChanged(keySequence);
emit q->editingFinished();
}
开发者ID:CSRedRat,项目名称:litetran,代码行数:8,代码来源:qkeysequenceedit.cpp
注:本文中的resetState函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论