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

C++ canceled函数代码示例

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

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



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

示例1: QProgressDialog

FileDownloader::FileDownloader(QWidget *parent) : QProgressDialog(parent)
{
	reply = 0;
	manager = new QNetworkAccessManager(this);
	connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(gotResponse(QNetworkReply*)));

	setMinimumDuration(0);
	setRange(0,0);

	connect(this, SIGNAL(canceled()), this, SLOT(cancelDownload()));
	/*
	connect(this, SIGNAL(fileSaved(const QString &, const QString &)), this, SLOT(reportFileSaved(const QString &,const QString &)));
	connect(this, SIGNAL(saveFailed(const QString &)), this, SLOT(reportSaveFailed(const QString &)));
	connect(this, SIGNAL(errorOcurred(int,QString)), this, SLOT(reportError(int,QString)));
	*/

	setWindowTitle(tr("Downloading..."));
}
开发者ID:dradetsky,项目名称:smplayer-mirror,代码行数:18,代码来源:filedownloader.cpp


示例2: switch

void Frame::setState(int a)
{
    m_state = a;

    switch(m_state)
    {
        case Frame::Started:
            emit started();
            break;
        case Frame::Canceled:
            emit canceled(QString::null);
            break;
        case Frame::Idle:
        case Frame::Completed:
        default:
            emit completed();
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:18,代码来源:frame.cpp


示例3: createCopylist

void TrackExportWorker::run() {
    int i = 0;
    QMap<QString, QFileInfo> copy_list = createCopylist(m_tracks);
    for (auto it = copy_list.constBegin(); it != copy_list.constEnd(); ++it) {
        // We emit progress twice per loop, which may seem excessive, but it
        // guarantees that we emit a sane progress before we start and after
        // we end.  In between, each filename will get its own visible tick
        // on the bar, which looks really nice.
        emit(progress(it->fileName(), i, copy_list.size()));
        copyFile(*it, it.key());
        if (load_atomic(m_bStop)) {
            emit(canceled());
            return;
        }
        ++i;
        emit(progress(it->fileName(), i, copy_list.size()));
    }
}
开发者ID:Alppasa,项目名称:mixxx,代码行数:18,代码来源:trackexportworker.cpp


示例4: Q_D

void QQuickMouseArea::ungrabMouse()
{
    Q_D(QQuickMouseArea);
    if (d->pressed) {
        // if our mouse grab has been removed (probably by Flickable), fix our
        // state
        d->pressed = 0;
        d->stealMouse = false;
        setKeepMouseGrab(false);
        emit canceled();
        emit pressedChanged();
        emit pressedButtonsChanged();
        if (d->hovered) {
            d->hovered = false;
            emit hoveredChanged();
        }
    }
}
开发者ID:crobertd,项目名称:qtdeclarative,代码行数:18,代码来源:qquickmousearea.cpp


示例5: uniform_corr_option

static int uniform_corr_option (const gchar *title, gretlopt *popt)
{
    const char *opts[] = {
	N_("Ensure uniform sample size"),
	NULL
    };
    int uniform = 0;
    int resp;

    resp = checks_only_dialog(title, NULL, opts, 1, 
			      &uniform, CORR, NULL);

    if (!canceled(resp) && uniform) {
	*popt = OPT_U;
    }

    return resp;
}
开发者ID:maupatras,项目名称:gretl,代码行数:18,代码来源:menustate.c


示例6: canceled

void K3b::DvdFormattingJob::slotProcessFinished( int exitCode, QProcess::ExitStatus exitStatus )
{
    if( d->canceled ) {
        emit canceled();
        d->success = false;
    }
    else if( exitStatus == QProcess::NormalExit ) {
        if( !d->error && (exitCode == 0) ) {
            emit infoMessage( i18n("Formatting successfully completed"), Job::MessageSuccess );

            if( d->lastProgressValue < 100 ) {
                emit infoMessage( i18n("Do not be concerned with the progress stopping before 100%."), MessageInfo );
                emit infoMessage( i18n("The formatting will continue in the background during writing."), MessageInfo );
            }

            d->success = true;
        }
        else {
            emit infoMessage( i18n("%1 returned an unknown error (code %2).",d->dvdFormatBin->name(), exitCode),
                              Job::MessageError );
            emit infoMessage( i18n("Please send me an email with the last output."), Job::MessageError );

            d->success = false;
        }
    }
    else {
        emit infoMessage( i18n("%1 did not exit cleanly.",d->dvdFormatBin->name()),
                          MessageError );
        d->success = false;
    }

    if( d->forceNoEject ||
        !k3bcore->globalSettings()->ejectMedia() ) {
        d->running = false;
        jobFinished(d->success);
    }
    else {
        emit infoMessage( i18n("Ejecting medium..."), MessageInfo );
        connect( Device::eject( d->device ),
                 SIGNAL(finished(K3b::Device::DeviceHandler*)),
                 this,
                 SLOT(slotEjectingFinished(K3b::Device::DeviceHandler*)) );
    }
}
开发者ID:KDE,项目名称:k3b,代码行数:44,代码来源:k3bdvdformattingjob.cpp


示例7: KRPleaseWait

void KRPleaseWaitHandler::startWaiting(QString msg, int count , bool cancel)
{
    if (dlg == 0) {
        dlg = new KRPleaseWait(msg , _parentWindow, count, cancel);
        connect(dlg, SIGNAL(canceled()), this, SLOT(killJob()));
    }
    incMutex = cycleMutex = _wasCancelled = false;
    dlg->setValue(0);

    dlg->setLabelText(msg);
    if (count == 0) {
        dlg->setMaximum(10);
        cycle = true ;
        cycleProgress();
    } else {
        dlg->setMaximum(count);
        cycle = false;
    }
}
开发者ID:aremai,项目名称:krusader,代码行数:19,代码来源:krpleasewait.cpp


示例8: QAbstractListModel

QDeclarativeBluetoothDiscoveryModel::QDeclarativeBluetoothDiscoveryModel(QObject *parent) :
    QAbstractListModel(parent),
    d(new QDeclarativeBluetoothDiscoveryModelPrivate)
{

    QHash<int, QByteArray> roleNames;
    roleNames = QAbstractItemModel::roleNames();
    roleNames.insert(Qt::DisplayRole, "name");
    roleNames.insert(Qt::DecorationRole, "icon");
    roleNames.insert(ServiceRole, "service");
    setRoleNames(roleNames);

    d->m_agent = new QBluetoothServiceDiscoveryAgent(this);
    connect(d->m_agent, SIGNAL(serviceDiscovered(const QBluetoothServiceInfo&)), this, SLOT(serviceDiscovered(const QBluetoothServiceInfo&)));
    connect(d->m_agent, SIGNAL(finished()), this, SLOT(finishedDiscovery()));
    connect(d->m_agent, SIGNAL(canceled()), this, SLOT(finishedDiscovery()));
    connect(d->m_agent, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)), this, SLOT(errorDiscovery(QBluetoothServiceDiscoveryAgent::Error)));

}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:19,代码来源:qdeclarativebluetoothdiscoverymodel.cpp


示例9: QTimer

void Downloader::setAnimator(QProgressDialog *anAnimator, QLabel* anAnimatorLabel, QProgressBar* anAnimatorBar, bool anAnimate)
{
    delete AnimationTimer;

    AnimatorLabel = anAnimatorLabel;
    AnimatorBar = anAnimatorBar;
    if (AnimatorBar && anAnimate)
    {
        AnimationTimer = new QTimer(this);
        connect(AnimationTimer,SIGNAL(timeout()),this,SLOT(animate()));
    }
    if (AnimatorBar)
    {
        AnimatorBar->setValue(0);
        if (anAnimator)
            connect(anAnimator,SIGNAL(canceled()),this,SLOT(on_Cancel_clicked()));
        qApp->processEvents();
    }
}
开发者ID:openstreetmap,项目名称:merkaartor,代码行数:19,代码来源:DownloadOSM.cpp


示例10: tr

void MainWindow::learning()
{
    QString dir_weight = QFileDialog::getOpenFileName(this, tr("Open File"), "/home", tr("Text (*.txt)"));
    dataset_ = new dataset_t(dir_weight.toStdString(), X_SIZE, Y_SIZE);
    dataset_->split_train_test(0.7);
    perceptron_ = new perceptron_t(dataset_->dim());

    thread_ = new QThread;
    connect(this, SIGNAL(finish_learn()), thread_, SLOT(quit()));
    connect(this, SIGNAL(finish_learn()), thread_, SLOT(deleteLater()));
    connect(thread_, SIGNAL(started()), this, SLOT(learn()));
    thread_->start();

    progress_ = new QProgressDialog("Learning...", "Cancel", 0, EPOCH_COUNT, this);
    connect(progress_, SIGNAL(canceled()), progress_, SLOT(cancel()));
    progress_->setWindowModality(Qt::WindowModal);

    ui->load->setDisabled(false);
}
开发者ID:LisGein,项目名称:LinuxCppLessons,代码行数:19,代码来源:mainwindow.cpp


示例11: SetupMenu

void QuteMessenger::startDeviceDiscovery()
{
    SetupMenu(true);
    if (devDisc) {
        ui.deviceListWidget->clear();
        foundDevices.clear();
        connect(devDisc, SIGNAL(newDeviceFound(QBtDevice)), this,
                SLOT(populateDeviceList(QBtDevice)));
        connect(devDisc, SIGNAL(discoveryStopped()), this, SLOT(deviceDiscoveryCompleteReport()));
        devDisc->startDiscovery();

        dialog = new QProgressDialog("Searching devices...", "Stop", 0, 0, this);
        dialog->setWindowModality(Qt::WindowModal);
        connect(dialog, SIGNAL(canceled()), this, SLOT(deviceDiscoveryCompleteReport()));
        dialog->setBar(NULL);

        dialog->show();
    }
}
开发者ID:favoritas37,项目名称:QBluetoothZero,代码行数:19,代码来源:QuteMessenger.cpp


示例12: state

UpdateApplication::UpdateApplication()
// ----------------------------------------------------------------------------
//    Constructor
// ----------------------------------------------------------------------------
    : state(Idle), file(NULL), progress(NULL),
      dialogTitle(QString(tr("Tao3D Update"))),
      downloadIcon(loadIcon(":/images/download.png")),
      checkmarkIcon(loadIcon(":images/checkmark.png")),
      connectionErrorIcon(loadIcon(":/images/not_connected.png")),
      reply(NULL), manager(NULL), code(-1)
{
    // download.png from http://www.iconfinder.com/icondetails/2085/128
    // Author: Alexandre Moore
    // License: LGPL
    //
    // checkmark.png from http://www.iconfinder.com/icondetails/3207/128
    // Author: Everaldo Coelho
    // License: LGPL

    // not_connected.png is a merge from:
    //
    // - Red cross from http://www.iconfinder.com/icondetails/3206/128
    //   Author: Everaldo Coelho
    //   License: LGPL
    // - Earth from http://www.iconfinder.com/icondetails/17829/128
    //   Author: Everaldo Coelho
    //   License: LGPL

    resetRequest();

    progress = new QProgressDialog(TaoApp->windowWidget());
    progress->setFixedSize(500, 100);
    connect(progress, SIGNAL(canceled()),
            this,     SLOT(cancel()));
    progress->setWindowTitle(dialogTitle);

    IFTRACE(update)
    debug() << "Current version: edition='" << +edition
            << "' version=" << version
            << " target='" << +target << "'"
            << " User-Agent='" << +userAgent() << "'\n";
}
开发者ID:ronotono,项目名称:tao-3D,代码行数:42,代码来源:update_application.cpp


示例13: nameFilters

void Widget::onSelectSong()
{
    QString strPath = QDir::currentPath();
    QStringList nameFilters("*.mp3");
    nameFilters << "*.wma" << "*.ape" << "*.ogg"
                << "*.aac" << "*.wav" << "*.mid"
                << "*.amr" << "*.3gp" << "*.mp4";

    m_fileSelector = new OpenFileWidget(strPath, nameFilters);
    m_layout->addWidget(m_fileSelector);
    m_layout->setCurrentWidget(m_fileSelector);

    m_fileSelector->setAttribute(Qt::WA_DeleteOnClose);
    connect(m_fileSelector, SIGNAL(selected(QString))
            , this, SLOT(onFileSelected(QString)));
    connect(m_fileSelector, SIGNAL(canceled())
            , this, SLOT(onFileSelectCanceled()));

    m_fileSelector->setStyleSheet("QListWidget{ background: #303030; border: 1px solid white}");
}
开发者ID:weilaidb,项目名称:qtexample,代码行数:20,代码来源:widget.cpp


示例14: QProgressDialog

void Updater::downloadUpdate()
{
    if(a_netManager->networkAccessible() != QNetworkAccessManager::NotAccessible)
    {
        a_progressDialog = new QProgressDialog(nullptr);
        a_progressDialog->setWindowModality(Qt::ApplicationModal);
        connect(a_progressDialog, SIGNAL(canceled()),this, SLOT(cancelDownload()));
        a_progressDialog->setWindowTitle(tr("Veuillez patienter"));
        a_progressDialog->setLabelText(tr("Téléchargement de la mise à jour de %1 en cours").arg(a_appName));
        a_progressDialog->setValue(0);
        a_progressDialog->show();
        a_netRequest.setUrl(a_urlExe);
        a_netReply = a_netManager->get(a_netRequest);
        connect(a_netReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(errorHandling(QNetworkReply::NetworkError)));
        connect(a_netReply, SIGNAL(finished()),this, SLOT(writeUpdate()));
        connect(a_netReply, SIGNAL(downloadProgress(qint64, qint64)),this, SLOT(updateProgress(qint64, qint64)));
    }
    else
        noNetworkError();
}
开发者ID:yiminyangguang520,项目名称:Updater,代码行数:20,代码来源:updater.cpp


示例15: connect

void Command::execute()
{
    d->m_lastExecSuccess = false;
    d->m_lastExecExitCode = -1;

    if (d->m_jobs.empty())
        return;

    // For some reason QtConcurrent::run() only works on this
    QFuture<void> task = QtConcurrent::run(&Command::run, this);
    d->m_watcher.setFuture(task);
    connect(&d->m_watcher, SIGNAL(canceled()), this, SLOT(cancel()));
    QString binary = QFileInfo(d->m_binaryPath).baseName();
    if (!binary.isEmpty())
        binary = binary.replace(0, 1, binary[0].toUpper()); // Upper the first letter
    const QString taskName = binary + QLatin1Char(' ') + d->m_jobs.front().arguments.at(0);

    Core::ProgressManager::addTask(task, taskName,
        Core::Id::fromString(binary + QLatin1String(".action")));
}
开发者ID:ZerpHmm,项目名称:qt-creator,代码行数:20,代码来源:command.cpp


示例16: QObject

CinemaProgress::CinemaProgress()
	: QObject()
	, startAppTimer_(0)
{
	startAppTimer_ = new QTimer(this);
	connect(startAppTimer_, SIGNAL(timeout()), SLOT(startApp()));
	startAppTimer_->setInterval(500);
	startAppTimer_->setSingleShot(true);

	cinemas_ = new CinemaList();
	cinemas_->setCanInitFromWeb(true);
	connect(cinemas_, SIGNAL(progressChanged()), SLOT(progressChanged()));
	QTimer::singleShot(100, cinemas_, SLOT(init()));

	progress_ = new QProgressDialog(trUtf8("Загружаю кинотеатры..."), trUtf8("Отмена"), 0, 0);
	connect(progress_, SIGNAL(canceled()), SLOT(cancel()));
	// progress_->setParent(this);
	progress_->setWindowModality(Qt::WindowModal);
	progress_->show();
}
开发者ID:mblsha,项目名称:afisha-cinema,代码行数:20,代码来源:cinemaprogress.cpp


示例17: QFileDialog

ImportDialog::ImportDialog(QWidget* parent) :
    QFileDialog(parent, WINDOW_NAME, DOWNLOAD_LOCATION, NULL),
    _progressBar(this),
    _importButton(IMPORT_BUTTON_NAME, this),
    _cancelButton(CANCEL_BUTTON_NAME, this),
    _mode(importMode) {

    setOption(QFileDialog::DontUseNativeDialog, true);
    setFileMode(QFileDialog::ExistingFile);
    setViewMode(QFileDialog::Detail);

    setImportTypes();
    setLayout();

    _progressBar.setRange(0, 100);
    
    connect(&_importButton, SIGNAL(pressed()), SLOT(accept()));
    connect(&_cancelButton, SIGNAL(pressed()), SIGNAL(canceled()));
    connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
}
开发者ID:Adrianl3d,项目名称:hifi,代码行数:20,代码来源:ImportDialog.cpp


示例18: connect

void GalleryWindow::connectSignals()
{
    connect(d->albumView, SIGNAL(itemSelectionChanged()),
            this , SLOT(slotAlbumSelected()) );

    connect(d->newAlbumBtn, SIGNAL(clicked()),
            this, SLOT(slotNewAlbum()));

    connect(d->addPhotoBtn, SIGNAL(clicked()),
            this, SLOT(slotAddPhoto()));

    connect(d->resizeCheckBox, SIGNAL(stateChanged(int)),
            this, SLOT(slotEnableSpinBox(int)));

    connect(d->logo, SIGNAL(leftClickedUrl(QString)),
            this, SLOT(slotProcessUrl(QString)));

    connect(m_progressDlg, SIGNAL(canceled()),
            this, SLOT(slotAddPhotoCancel()));

    connect(m_talker, SIGNAL(signalError(QString)),
            this, SLOT(slotError(QString)));

    connect(m_talker, SIGNAL(signalBusy(bool)),
            this, SLOT(slotBusy(bool)));

    connect(m_talker, SIGNAL(signalLoginFailed(QString)),
            this, SLOT(slotLoginFailed(QString)));

    connect(m_talker, SIGNAL(signalAlbums(QList<GAlbum>)),
            this, SLOT(slotAlbums(QList<GAlbum>)));

    connect(m_talker, SIGNAL(signalPhotos(QList<GPhoto>)),
            this, SLOT(slotPhotos(QList<GPhoto>)));

    connect(m_talker, SIGNAL(signalAddPhotoSucceeded()),
            this, SLOT(slotAddPhotoSucceeded()));

    connect(m_talker, SIGNAL(signalAddPhotoFailed(QString)),
            this, SLOT(slotAddPhotoFailed(QString)));
}
开发者ID:rosedu,项目名称:digikam-2012-kipi-plugins,代码行数:41,代码来源:gallerywindow.cpp


示例19: QProgressDialog

BtRefreshProgressDialog::BtRefreshProgressDialog(sword::InstallSource &source,
                                                 QWidget *parent,
                                                 Qt::WindowFlags flags)
             : QProgressDialog(parent, flags)
             , m_source(source)
{
    Q_ASSERT(BtInstallBackend::isRemote(source));
    setWindowTitle(tr("Refreshing source %1").arg(QString(source.caption)));
    setCancelButtonText(tr("&Cancel"));
    setLabelText(tr("Connecting..."));
    Q_ASSERT(minimum() == 0);
    setMaximum(100);
    setValue(0);
    setWindowModality(Qt::ApplicationModal);
    setMinimumDuration(1000);

    connect(this, SIGNAL(canceled()),
            this, SLOT(slotCanceled()));
    connect(&m_installMgr, SIGNAL(percentCompleted(int,int)),
            this,          SLOT(slotPercentCompleted(int,int)));
}
开发者ID:Gandh1PL,项目名称:bibletime,代码行数:21,代码来源:btrefreshprogressdialog.cpp


示例20: percent

void K3b::BlankingJob::slotFinished(bool success)
{
    if ( !m_forceNoEject && k3bcore->globalSettings()->ejectMedia() ) {
        K3b::Device::eject( m_device );
    }

    if( success ) {
        emit percent( 100 );
        jobFinished( true );
    }
    else {
        if( m_canceled ) {
            emit canceled();
        }
        else {
            emit infoMessage( i18n("Blanking error."), K3b::Job::MessageError );
            emit infoMessage( i18n("Sorry, no error handling yet."), K3b::Job::MessageError );
        }
        jobFinished( false );
    }
}
开发者ID:franhaufer,项目名称:k3b,代码行数:21,代码来源:k3bblankingjob.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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