本文整理汇总了C++中setFinished函数的典型用法代码示例。如果您正苦于以下问题:C++ setFinished函数的具体用法?C++ setFinished怎么用?C++ setFinished使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFinished函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setError
/** @short Data for the current message part are available now */
void MsgPartNetworkReply::slotMyDataChanged()
{
if (part.data(Mailbox::RoleIsUnavailable).toBool()) {
setError(TimeoutError, tr("Offline"));
setFinished(true);
emit error(TimeoutError);
emit finished();
return;
}
if (!part.data(Mailbox::RoleIsFetched).toBool())
return;
MsgPartNetAccessManager *netAccess = qobject_cast<MsgPartNetAccessManager*>(manager());
Q_ASSERT(netAccess);
QString mimeType = netAccess->translateToSupportedMimeType(part.data(Mailbox::RolePartMimeType).toString());
QString charset = part.data(Mailbox::RolePartCharset).toString();
if (mimeType.startsWith(QLatin1String("text/"))) {
setHeader(QNetworkRequest::ContentTypeHeader,
charset.isEmpty() ? mimeType : QStringLiteral("%1; charset=%2").arg(mimeType, charset)
);
} else {
setHeader(QNetworkRequest::ContentTypeHeader, mimeType);
}
setFinished(true);
emit readyRead();
emit finished();
}
开发者ID:ChristopherCotnoir,项目名称:trojita,代码行数:29,代码来源:MsgPartNetworkReply.cpp
示例2: switch
int Sample::process_bg() {
/*
This function does the main thing: it stretches the original data as defined by the marker object.
Therefore it reads data from odata and writes to data.
*/
_processing=true;
// setup data
length=getGuessedLength();
delete[] data;
data=new float[length];
switch (getStretchMode()) {
#ifdef MODE_RUBBERBAND
case 1:
RBprocess(olength, data, marker, this);
break;
#endif
default: {
for (int i=0; i<length; ++i) {
data[i]=getOld(marker->new2old(marker->nnew2new(i/(float)length)));
setFinished(i/(float)length);
}
}
}
setFinished(1);
_processing=false;
return 0;
}
开发者ID:xi,项目名称:xiRetimer,代码行数:27,代码来源:sample.cpp
示例3: setFinished
bool QuitGame::handleEvent(const sf::Input &Input) {
if(Input.IsKeyDown(sf::Key::Y)) {
setFinished();
if(m_panel != NULL) {
m_panel->setQuit();
}
}
if(Input.IsKeyDown(sf::Key::N)) {
setFinished();
}
return true;
}
开发者ID:andressbarajas,项目名称:Isla-Vista-Tower-Defense,代码行数:12,代码来源:cQuit.cpp
示例4: parser
void QGeoRouteReplyNokia::networkFinished()
{
if (!m_reply)
return;
if (m_reply->error() != QNetworkReply::NoError) {
// Removed because this is already done in networkError, which previously caused _two_ errors to be raised for every error.
//setError(QGeoRouteReply::CommunicationError, m_reply->errorString());
//m_reply->deleteLater();
//m_reply = 0;
return;
}
QGeoRouteXmlParser parser(request());
if (parser.parse(m_reply)) {
setRoutes(parser.results());
setFinished(true);
} else {
// add a qWarning with the actual parser.errorString()
setError(QGeoRouteReply::ParseError, "The response from the service was not in a recognisable format.");
}
m_reply->deleteLater();
m_reply = 0;
}
开发者ID:amccarthy,项目名称:qtlocation,代码行数:26,代码来源:qgeoroutereply_nokia.cpp
示例5: setMapImageData
void QGeoMapReplyOsm::networkReplyFinished()
{
if (!m_reply)
return;
if (m_reply->error() != QNetworkReply::NoError)
return;
QByteArray a = m_reply->readAll();
setMapImageData(a);
switch (tileSpec().mapId()) {
case 1:
setMapImageFormat("png");
break;
case 2:
setMapImageFormat("png");
break;
default:
qWarning("Unknown map id %d", tileSpec().mapId());
}
setFinished(true);
m_reply->deleteLater();
m_reply = 0;
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:27,代码来源:qgeomapreplyosm.cpp
示例6: setCached
void QGeoMapReplyNokia::networkFinished()
{
if (!m_reply)
return;
if (m_reply->error() != QNetworkReply::NoError)
return;
QVariant fromCache = m_reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute);
setCached(fromCache.toBool());
if (!isCached()) {
QAbstractNetworkCache *cache = m_reply->manager()->cache();
if (cache) {
QNetworkCacheMetaData metaData = cache->metaData(m_reply->url());
QDateTime exp = QDateTime::currentDateTime();
exp = exp.addDays(14);
metaData.setExpirationDate(exp);
cache->updateMetaData(metaData);
}
}
setMapImageData(m_reply->readAll());
setMapImageFormat("PNG");
setFinished(true);
m_reply->deleteLater();
m_reply = 0;
}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:29,代码来源:qgeomapreply_nokia.cpp
示例7: viewport
void QGeoCodeReplyNokia::networkFinished()
{
if (!m_reply)
return;
if (m_reply->error() != QNetworkReply::NoError) {
// Removed because this is already done in networkError, which previously caused _two_ errors to be raised for every error.
//setError(QGeoCodeReply::CommunicationError, m_reply->errorString());
//m_reply->deleteLater();
//m_reply = 0;
return;
}
QGeoCodeXmlParser parser;
if (parser.parse(m_reply)) {
QList<QGeoLocation> locations = parser.results();
QGeoShape bounds = viewport();
if (bounds.isValid()) {
for (int i = locations.size() - 1; i >= 0; --i) {
if (!bounds.contains(locations[i].coordinate()))
locations.removeAt(i);
}
}
setLocations(locations);
setFinished(true);
} else {
setError(QGeoCodeReply::ParseError, parser.errorString());
}
m_reply->deleteLater();
m_reply = 0;
}
开发者ID:agunnarsson,项目名称:qtlocation,代码行数:32,代码来源:qgeocodereply_nokia.cpp
示例8: if
void RemoteLinuxEnvironmentReader::remoteProcessFinished()
{
if (m_stop)
return;
m_env.clear();
QString errorMessage;
if (m_deviceProcess->exitStatus() != QProcess::NormalExit) {
errorMessage = m_deviceProcess->errorString();
} else if (m_deviceProcess->exitCode() != 0) {
errorMessage = tr("Process exited with code %1.")
.arg(m_deviceProcess->exitCode());
}
if (!errorMessage.isEmpty()) {
errorMessage = tr("Error running 'env': %1").arg(errorMessage);
const QString remoteStderr
= QString::fromUtf8(m_deviceProcess->readAllStandardError()).trimmed();
if (!remoteStderr.isEmpty())
errorMessage += QLatin1Char('\n') + tr("Remote stderr was: \"%1\"").arg(remoteStderr);
emit error(errorMessage);
} else {
QString remoteOutput = QString::fromUtf8(m_deviceProcess->readAllStandardOutput());
if (!remoteOutput.isEmpty()) {
m_env = Utils::Environment(remoteOutput.split(QLatin1Char('\n'),
QString::SkipEmptyParts), Utils::OsTypeLinux);
}
}
setFinished();
}
开发者ID:DuinoDu,项目名称:qt-creator,代码行数:29,代码来源:remotelinuxenvironmentreader.cpp
示例9: error
void QPlaceDetailsReplyImpl::setError(QPlaceReply::Error error_, const QString &errorString)
{
QPlaceReply::setError(error_, errorString);
emit error(error_, errorString);
setFinished(true);
emit finished();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:7,代码来源:qplacedetailsreplyimpl.cpp
示例10: qCDebug
void PendingOperation::setFinishedWithError(const QVariantHash &details)
{
qCDebug(c_pendingOperations) << this << "setFinishedWithError(" << details << ")";
d->m_succeeded = false;
d->m_errorDetails = details;
setFinished();
}
开发者ID:Kaffeine,项目名称:telegram-qt,代码行数:7,代码来源:PendingOperation.cpp
示例11: setFinished
void ThreadedAssignment::checkInWithDomainServerOrExit() {
if (NodeList::getInstance()->getNumNoReplyDomainCheckIns() == MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
setFinished(true);
} else {
NodeList::getInstance()->sendDomainServerCheckIn();
}
}
开发者ID:RyanDowne,项目名称:hifi,代码行数:7,代码来源:ThreadedAssignment.cpp
示例12: error
/*!
Sets the error state of this reply to \a error and the textual
representation of the error to \a errorString.
This will also cause error() and finished() signals to be emitted, in that
order.
*/
void QGeoCodeReply::setError(QGeoCodeReply::Error error, const QString &errorString)
{
d_ptr->error = error;
d_ptr->errorString = errorString;
emit this->error(error, errorString);
setFinished(true);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:14,代码来源:qgeocodereply.cpp
示例13: setError
void QPlaceContentReplyImpl::replyFinished()
{
if (m_reply->isOpen()) {
QJsonDocument document = QJsonDocument::fromJson(m_reply->readAll());
if (!document.isObject()) {
setError(ParseError, QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, PARSE_ERROR));
return;
}
QJsonObject object = document.object();
QPlaceContent::Collection collection;
int totalCount;
QPlaceContentRequest previous;
QPlaceContentRequest next;
parseCollection(request().contentType(), object, &collection, &totalCount,
&previous, &next, m_engine);
setTotalCount(totalCount);
setContent(collection);
setPreviousPageRequest(previous);
setNextPageRequest(next);
}
m_reply->deleteLater();
m_reply = 0;
setFinished(true);
emit finished();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:31,代码来源:qplacecontentreplyimpl.cpp
示例14: switch
void RS_ActionDrawText::init(int status) {
RS_ActionInterface::init(status);
if (RS_DIALOGFACTORY) {
switch (status) {
case ShowDialog: {
reset();
RS_Text tmp(NULL, *data);
if (RS_DIALOGFACTORY->requestTextDialog(&tmp)) {
data.reset(new RS_TextData(tmp.getData()));
setStatus(SetPos);
showOptions();
} else {
hideOptions();
setFinished();
}
}
break;
case SetPos:
RS_DIALOGFACTORY->requestOptions(this, true, true);
deletePreview();
preview->setVisible(true);
preparePreview();
break;
default:
break;
}
}
}
开发者ID:Harpalus,项目名称:LibreCAD,代码行数:32,代码来源:rs_actiondrawtext.cpp
示例15: switch
void XTelepathyPasswordAuthOperation::onDialogFinished(int result)
{
switch (result) {
case QDialog::Rejected:
qDebug() << "Authentication cancelled";
m_saslIface->AbortSASL(Tp::SASLAbortReasonUserAbort, i18n("User cancelled auth"));
setFinished();
if (!m_dialog.isNull()) {
m_dialog.data()->deleteLater();
}
return;
case QDialog::Accepted:
// save password in kwallet if necessary...
if (!m_dialog.isNull()) {
if (m_dialog.data()->savePassword()) {
qDebug() << "Saving password in SSO";
m_canFinish = false;
storeCredentials(m_dialog.data()->password());
} else {
m_canFinish = true;
}
m_dialog.data()->deleteLater();
m_saslIface->StartMechanismWithData(QLatin1String("X-TELEPATHY-PASSWORD"), m_dialog.data()->password().toUtf8());
}
}
}
开发者ID:netrunner-debian-kde-extras,项目名称:kde-telepathy-ktp-auth-handler,代码行数:28,代码来源:x-telepathy-password-auth-operation.cpp
示例16: info
bool RbUtilQt::installAuto()
{
QString file = RbSettings::value(RbSettings::ReleaseUrl).toString();
file.replace("%MODEL%", RbSettings::value(RbSettings::CurBuildserverModel).toString());
file.replace("%RELVERSION%", versmap.value("rel_rev"));
buildInfo.open();
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
buildInfo.close();
// check installed Version and Target
QString warning = check(false);
if(!warning.isEmpty())
{
if(QMessageBox::warning(this, tr("Really continue?"), warning,
QMessageBox::Ok | QMessageBox::Abort, QMessageBox::Abort)
== QMessageBox::Abort)
{
logger->addItem(tr("Aborted!"), LOGERROR);
logger->setFinished();
return false;
}
}
// check version
RockboxInfo rbinfo(RbSettings::value(RbSettings::Mountpoint).toString());
if(rbinfo.version() != "")
{
if(QMessageBox::question(this, tr("Installed Rockbox detected"),
tr("Rockbox installation detected. Do you want to backup first?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
{
logger->addItem(tr("Starting backup..."),LOGINFO);
QString backupName = RbSettings::value(RbSettings::Mountpoint).toString()
+ "/.backup/rockbox-backup-" + rbinfo.version() + ".zip";
//! create dir, if it doesnt exist
QFileInfo backupFile(backupName);
if(!QDir(backupFile.path()).exists())
{
QDir a;
a.mkpath(backupFile.path());
}
//! create backup
RbZip backup;
connect(&backup,SIGNAL(zipProgress(int,int)),logger, SLOT(setProgress(int,int)));
if(backup.createZip(backupName,
RbSettings::value(RbSettings::Mountpoint).toString() + "/.rockbox") == Zip::Ok)
{
logger->addItem(tr("Backup successful"),LOGOK);
}
else
{
logger->addItem(tr("Backup failed!"),LOGERROR);
logger->setFinished();
return false;
}
}
}
开发者ID:Megaco,项目名称:rockbox,代码行数:59,代码来源:rbutilqt.cpp
示例17: disconnect
void REIXSXESScanController::onScanFinished() {
scanProgressTimer_.stop();
disconnect(&scanProgressTimer_, SIGNAL(timeout()), this, SLOT(onScanProgressCheck()));
disconnect(REIXSBeamline::bl()->mcpDetector(), SIGNAL(imageDataChanged()), this, SLOT(onNewImageValues()));
saveRawData();
setFinished();
}
开发者ID:acquaman,项目名称:acquaman,代码行数:8,代码来源:REIXSXESScanController.cpp
示例18: error
void RemoteLinuxEnvironmentReader::handleError()
{
if (m_stop)
return;
emit error(tr("Error: %1").arg(m_deviceProcess->errorString()));
setFinished();
}
开发者ID:DuinoDu,项目名称:qt-creator,代码行数:8,代码来源:remotelinuxenvironmentreader.cpp
示例19: setFinished
void PendingClear::finish()
{
if (errorName.isEmpty()) {
setFinished();
} else {
setFinishedWithError(errorName, errorMessage);
}
}
开发者ID:detrout,项目名称:telepathy-logger-qt,代码行数:8,代码来源:pending-clear.cpp
示例20: setError
void CoapReply::resend()
{
m_retransmissions++;
if (m_retransmissions > 5) {
setError(CoapReply::TimeoutError);
setFinished();
}
}
开发者ID:tonnenpinguin,项目名称:guh,代码行数:8,代码来源:coapreply.cpp
注:本文中的setFinished函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论