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


C++ canceled函数代码示例

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


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


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