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

C++ showErrorDialog函数代码示例

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

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



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

示例1: showErrorDialog

void ReportWizard::on_pushButton_submit_clicked()
{
    QDate startDate = ui->dateEdit_startDate->date(), endDate = ui->dateEdit_endDate->date();
    if (endDate < startDate)
    {
        showErrorDialog("Start date must be before end date");
        return;
    }

    QString reportPath = SettingForm::getPdfDirectoryWithoutSlash() + "/reports";
    if (!QDir(reportPath).exists()) QDir().mkpath(reportPath);

    QString suggestedFilename
            = reportPath + "/report_" + toString(startDate.day()).c_str()
            + QDate::longMonthName(startDate.month()) + toString(startDate.year()).c_str() + "_to_"
            + toString(endDate.day()).c_str() + QDate::longMonthName(endDate.month()) + '_'
            + toString(endDate.year()).c_str() + ".pdf";

    QString filename = QFileDialog::getSaveFileName(this, "Save Report As", suggestedFilename, "PDF (*.pdf)");
    if (filename.isEmpty()) return;

    if (PdfGenerator::generateReport(filename.toStdString().c_str(), startDate, endDate))
    {
        showInfoDialog("Report generated successfully");
        QDesktopServices::openUrl(QUrl("file:///" + filename));
        done(Accepted);
    }
    else showErrorDialog("Report could not be generated");
}
开发者ID:supermaximo93,项目名称:Computing_Project,代码行数:29,代码来源:ReportWizard.cpp


示例2: catch

bool PartController::Update(const Part &part, QWidget *)
{
    bool success = false;
    try { success = Databases::parts().updateRecord(part); }
    catch (const std::exception &e)
    {
        showErrorDialog(e.what());
        return false;
    }

    if (!success) showErrorDialog("There was an error with updating the part in the database");
    return success;
}
开发者ID:supermaximo93,项目名称:Computing_Project,代码行数:13,代码来源:PartController.cpp


示例3: catch

bool TaskController::Destroy(const int taskId, QWidget *)
{
    bool success = false;
    try { success = Databases::tasks().deleteRecord(taskId); }
    catch (const std::exception &e)
    {
        showErrorDialog(e.what());
        return false;
    }

    if (!success) showErrorDialog("There was an error with removing the task from the database");
    return success;
}
开发者ID:supermaximo93,项目名称:Computing_Project,代码行数:13,代码来源:TaskController.cpp


示例4: catch

bool VatRateController::Update(const VatRate &vatRate, QWidget *)
{
    bool success = false;
    try { success = Databases::vatRates().updateRecord(vatRate); }
    catch (const std::exception &e)
    {
        showErrorDialog(e.what());
        return false;
    }

    if (!success) showErrorDialog("There was an error with updating the VAT rate in the database");
    return success;
}
开发者ID:supermaximo93,项目名称:Computing_Project,代码行数:13,代码来源:VatRateController.cpp


示例5: showErrorDialog

void PresentationAudioListItem::slotMediaStateChanged(QMediaPlayer::MediaStatus status)
{
    if (status == QMediaPlayer::UnknownMediaStatus ||
        status == QMediaPlayer::NoMedia            ||
        status == QMediaPlayer::InvalidMedia)
    {
        showErrorDialog();
        return;
    }

    qint64 total = d->mediaObject->duration();
    int hours      = (int)(total  / (long int)( 60 * 60 * 1000 ));
    int mins       = (int)((total / (long int)( 60 * 1000 )) - (long int)(hours * 60));
    int secs       = (int)((total / (long int)1000) - (long int)(hours * 60 * 60) - (long int)(mins * 60));
    d->totalTime   = QTime(hours, mins, secs);
    d->artist      = (d->mediaObject->metaData(QMediaMetaData::Author)).toStringList().join(QString::fromLatin1(","));
    d->title       = (d->mediaObject->metaData(QMediaMetaData::Title)).toString();

    if ( d->artist.isEmpty() && d->title.isEmpty() )
        setText(d->url.fileName());
    else
        setText(i18nc("artist - title", "%1 - %2", artist(), title()));

    emit signalTotalTimeReady(d->url, d->totalTime);
}
开发者ID:Match-Yang,项目名称:digikam,代码行数:25,代码来源:presentationaudiolist.cpp


示例6: dialog

void MainWindow::rotateSelectedObj(GtkBuilder* builder){
    RotateDialog dialog(GTK_BUILDER(builder));
    bool finish = false;

    std::string name;
    GtkTreeIter iter;

    if(!getSelectedObjName(name, &iter))
        return;

    while(!finish){
        if(dialog.run() == 1){
            try{
                Object* obj = _world->rotateObj(name, dialog.getAngulo(),
                                    Coordinate(dialog.getCX(), dialog.getCY()),
                                        dialog.getRotateType());
                _viewport->transformObj(obj);

                gtk_widget_queue_draw(_mainWindow);
                log("Objeto rotacionado.\n");
                finish = true;
            }catch(MyException& e){
                log(e.what());
                showErrorDialog(e.what());
            }
        }else
            finish = true;
    }
}
开发者ID:nogenem,项目名称:Computacao-Grafica-2015-2,代码行数:29,代码来源:MainWindow.hpp


示例7: qDebug

void FvUpdater::httpFeedDownloadFinished()
{
	if (m_httpRequestAborted) {
		m_reply->deleteLater();
		return;
	}

	QVariant redirectionTarget = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
	if (m_reply->error()) {

    qDebug() << " error value " << m_reply->error();
		// Error.
        showErrorDialog(tr("Updates are unable to detect: %1.").arg(m_reply->errorString()), NO_UPDATE_MESSAGE);
    emit updatesDownloaded(false);

	} else if (! redirectionTarget.isNull()) {
		QUrl newUrl = m_feedURL.resolved(redirectionTarget.toUrl());

		m_feedURL = newUrl;
		m_reply->deleteLater();

		startDownloadFeed(m_feedURL);
		return;

	} else {

		// Done.
		xmlParseFeed();
    emit updatesDownloaded(true);

	}

	m_reply->deleteLater();
	m_reply = 0;
}
开发者ID:Autumncoindev,项目名称:ATM,代码行数:35,代码来源:fvupdater.cpp


示例8: Shader

bool Material::loadAndInitializeMaterial(const string& effectName, ID3D11Device* pd3dDevice, const InputLayoutDescription& inputDescription)
{
    bool succesfull = true;
    ID3D11InputLayout* layout;
    m_shader = new Shader(effectName, pd3dDevice);
    succesfull = m_shader->isShaderInitialized();
    if (!succesfull) {
        return succesfull;
    }

    D3DX11_PASS_DESC PassDesc;
    m_shader->getEffect()->GetTechniqueByIndex(0)->GetPassByIndex( 0 )->GetDesc( &PassDesc );
    HRESULT hr = pd3dDevice->CreateInputLayout(inputDescription.getElementDescriptions(),
                 inputDescription.getElementCount(), PassDesc.pIAInputSignature,
                 PassDesc.IAInputSignatureSize, &layout );


    if(FAILED(hr))
        showErrorDialog("Failed to create input layout");

    m_layout = layout;
    layout->Release();

    return succesfull;
}
开发者ID:Manaluusua,项目名称:Dx11Sandbox,代码行数:25,代码来源:Material.cpp


示例9: qDebug

void AuthenticationDialog::urlChanged(const QUrl &url)
{
    qDebug() << "Navigating to" << url;
    if (url.host() == QStringLiteral("oauth.vk.com") && url.path() == QStringLiteral("/blank.html"))
    {
        const QUrlQuery query(url);

        d->error = query.queryItemValue(QStringLiteral("error"));
        d->errorDescription = query.queryItemValue(QStringLiteral("error_description")).replace(QLatin1Char('+'), QLatin1Char(' '));
        if (!d->error.isEmpty() || !d->errorDescription.isEmpty())
        {
            QTimer::singleShot(0, this, SLOT(showErrorDialog()));
            return;
        }

        // The URL comes in the form "bla#access_token=bla&expires_in=foo", we need to convert from
        // # to ?
        const QUrl fixedURL = QUrl::fromUserInput(url.toString().replace(QLatin1Char('#'), QLatin1Char('?')));
        const QUrlQuery fixedQuery(fixedURL);
        const QString accessToken = fixedQuery.queryItemValue(QStringLiteral("access_token"));
        const QString tokenExpiresIn = fixedQuery.queryItemValue(QStringLiteral("expires_in")); // TODO: use this for something?
        if (!accessToken.isEmpty())
        {
            emit authenticated(accessToken);
            QTimer::singleShot(0, this, SLOT(close()));
        }
    }
}
开发者ID:KDE,项目名称:libkvkontakte,代码行数:28,代码来源:authenticationdialog.cpp


示例10: dialog

void MainWindow::addPoint(GtkBuilder* builder){
    PointDialog dialog(GTK_BUILDER(builder));
    bool finish = false;

    while(!finish){
        if(dialog.run() == 1){
            try{
                Coordinate c(dialog.getX(),dialog.getY(),dialog.getZ());

                Object* obj = m_world->addPoint(
                                    dialog.getName(), dialog.getColor(), c);
                m_viewport->transformAndClipObj(obj);
                addObjOnListStore(dialog.getName(), "Point");

                gtk_widget_queue_draw(m_mainWindow);
                log("Novo ponto adicionado.\n");
                finish = true;
            }catch(MyException& e){
                log(e.what());
                showErrorDialog(e.what());
            }
        }else
            finish = true;
    }
}
开发者ID:nogenem,项目名称:Computacao-Grafica-2015-2,代码行数:25,代码来源:MainWindow.hpp


示例11: if

void QUPDUpdater::changelogHttpDownloadFinished()
{
    if (_changelogReply ) {
        QVariant redirectionTarget = _changelogReply->attribute(QNetworkRequest::RedirectionTargetAttribute);
        if (_changelogRequestAborted) {
            _changelogReply->deleteLater();
            _changelogReply = 0;
        }
        else if (_changelogReply->error()) {
            showErrorDialog(tr("New Version download failed: %1.").arg(_changelogReply->errorString()), false);
            emit downloadChangelogError();
            _changelogReply->deleteLater();
            _changelogReply = 0;
        } else if (! redirectionTarget.isNull()) {
            proposedUpdate()->setReleaseNoteLink(_changelogReply->url().resolved(redirectionTarget.toUrl()).toString());
            _changelogReply->deleteLater();
            startDownloadChangelog();
        } else {
            emit downloadChangelogSuccess();

            _changelogReply->deleteLater();
            _changelogReply = 0;
        }
    }
}
开发者ID:idtek,项目名称:qUpdater,代码行数:25,代码来源:qupd_changelogmanager.cpp


示例12: catch

bool SubscriptionManager::checkSubscription(int& edition)
{
	edition = Unknown;
	CoreInterface coreInterface;
	QString output;
	try
	{
		output = coreInterface.checkSubscription();
	}
	catch (std::exception& e)
	{
		showErrorDialog(e.what());
		return false;
	}

	if (output.contains("subscription will expire soon")) {
		QMessageBox::warning(
			this, tr("Activate Subscription"),
			tr("Your subscription will be expired soon."));
	}

	edition = getEditionType(output);

	return true;
}
开发者ID:sebgregoire,项目名称:synergy,代码行数:25,代码来源:SubscriptionManager.cpp


示例13: showErrorDialog

void FvUpdater::httpFeedDownloadFinished()
{
	if (m_httpRequestAborted) {
		m_reply->deleteLater();
		return;
	}

	QVariant redirectionTarget = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
	if (m_reply->error()) {

		// Error.
		showErrorDialog(tr("Feed download failed: %1.").arg(m_reply->errorString()), false);

	} else if (! redirectionTarget.isNull()) {
		QUrl newUrl = m_feedURL.resolved(redirectionTarget.toUrl());

		m_feedURL = newUrl;
		m_reply->deleteLater();

		startDownloadFeed(m_feedURL);
		return;

	} else {

		// Done.
		xmlParseFeed();

	}

	m_reply->deleteLater();
	m_reply = 0;
}
开发者ID:bilke,项目名称:fervor,代码行数:32,代码来源:fvupdater.cpp


示例14: qDebug

void AssetUploadDialogFactory::showDialog() {
    auto nodeList = DependencyManager::get<NodeList>();
    
    if (nodeList->getThisNodeCanRez()) {
        auto filename = QFileDialog::getOpenFileName(_dialogParent, "Select a file to upload");
        
        if (!filename.isEmpty()) {
            qDebug() << "Selected filename for upload to asset-server: " << filename;
            
            auto assetClient = DependencyManager::get<AssetClient>();
            auto upload = assetClient->createUpload(filename);
            
            if (upload) {
                // connect to the finished signal so we know when the AssetUpload is done
                QObject::connect(upload, &AssetUpload::finished, this, &AssetUploadDialogFactory::handleUploadFinished);
                
                // start the upload now
                upload->start();
            } else {
                // show a QMessageBox to say that there is no local asset server
                QString messageBoxText = QString("Could not upload \n\n%1\n\nbecause you are currently not connected" \
                                                 " to a local asset-server.").arg(QFileInfo(filename).fileName());
                
                QMessageBox::information(_dialogParent, "Failed to Upload", messageBoxText);
            }
        }
    } else {
        // we don't have permission to upload to asset server in this domain - show the permission denied error
        showErrorDialog(QString(), PERMISSION_DENIED_ERROR);
    }
    
}
开发者ID:GabrielPathfinder,项目名称:hifi,代码行数:32,代码来源:AssetUploadDialogFactory.cpp


示例15: QDialog

void AssetUploadDialogFactory::handleUploadFinished(AssetUpload* upload, const QString& hash) {
    if (upload->getError() == AssetUpload::NoError) {
        // show message box for successful upload, with copiable text for ATP hash
        QDialog* hashCopyDialog = new QDialog(_dialogParent);
        
        // delete the dialog on close
        hashCopyDialog->setAttribute(Qt::WA_DeleteOnClose);
        
        // set the window title
        hashCopyDialog->setWindowTitle(tr("Successful Asset Upload"));
        
        // setup a layout for the contents of the dialog
        QVBoxLayout* boxLayout = new QVBoxLayout;
        
        // set the label text (this shows above the text box)
        QLabel* lineEditLabel = new QLabel;
        lineEditLabel->setText(QString("ATP URL for %1").arg(QFileInfo(upload->getFilename()).fileName()));
        
        // setup the line edit to hold the copiable text
        QLineEdit* lineEdit = new QLineEdit;
       
        QString atpURL = QString("%1:%2.%3").arg(URL_SCHEME_ATP).arg(hash).arg(upload->getExtension());
        
        // set the ATP URL as the text value so it's copiable
        lineEdit->insert(atpURL);
        
        // figure out what size this line edit should be using font metrics
        QFontMetrics textMetrics { lineEdit->font() };
        
        // set the fixed width on the line edit
        // pad it by 10 to cover the border and some extra space on the right side (for clicking)
        static const int LINE_EDIT_RIGHT_PADDING { 10 };
        
        lineEdit->setFixedWidth(textMetrics.width(atpURL) + LINE_EDIT_RIGHT_PADDING );
        
        // left align the ATP URL line edit
        lineEdit->home(true);
        
        // add the label and line edit to the dialog
        boxLayout->addWidget(lineEditLabel);
        boxLayout->addWidget(lineEdit);
        
        // setup an OK button to close the dialog
        QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
        connect(buttonBox, &QDialogButtonBox::accepted, hashCopyDialog, &QDialog::close);
        boxLayout->addWidget(buttonBox);
        
        // set the new layout on the dialog
        hashCopyDialog->setLayout(boxLayout);
        
        // show the new dialog
        hashCopyDialog->show();
    } else {
        // display a message box with the error
        showErrorDialog(upload, _dialogParent);
    }
    
    upload->deleteLater();
}
开发者ID:Giugiogia,项目名称:hifi,代码行数:59,代码来源:AssetUploadDialogFactory.cpp


示例16: qCDebug

void PresentationAudioListItem::slotPlayerError(QMediaPlayer::Error err)
{
    if (err != QMediaPlayer::NoError)
    {
        qCDebug(DIGIKAM_GENERAL_LOG) << "An error as occured while playing (" << err << ")";
        showErrorDialog();
    }
}
开发者ID:Match-Yang,项目名称:digikam,代码行数:8,代码来源:presentationaudiolist.cpp


示例17: showErrorDialog

void MainWindow::on_pushButton_help_clicked()
{
    const QString userGuideFileName = QDir::currentPath() + "/user_guide.html";

    QFile::copy(":html/user_guide.html", userGuideFileName);

    if (QFile::exists(userGuideFileName)) QDesktopServices::openUrl(QUrl("file:///" + userGuideFileName));
    else showErrorDialog(("File '" + userGuideFileName + "' could not be opened").toStdString().c_str());
}
开发者ID:supermaximo93,项目名称:Computing_Project,代码行数:9,代码来源:MainWindow.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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