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


C++ SystemDialog::deleteLater方法代码示例

本文整理汇总了C++中SystemDialog::deleteLater方法的典型用法代码示例。如果您正苦于以下问题:C++ SystemDialog::deleteLater方法的具体用法?C++ SystemDialog::deleteLater怎么用?C++ SystemDialog::deleteLater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SystemDialog的用法示例。


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

示例1: onPromptFinishedCreateComment

void BugReportController::onPromptFinishedCreateComment(bb::system::SystemUiResult::Type result) {

    using namespace bb::cascades;
    using namespace bb::system;

    if(result != bb::system::SystemUiResult::ConfirmButtonSelection) {
        SystemDialog* prompt = qobject_cast<SystemDialog*>(sender());
        prompt->deleteLater();
        return;
    }

    SystemDialog* prompt = qobject_cast<SystemDialog*>(sender());
    prompt->deleteLater();

    const QUrl url(GITHUB_URL + REPOSITORY + "/issues/" + QString::number(m_TmpLabel) + "/comments");


    QString label_str = m_Labels.key(m_TmpLabel);


    QByteArray datas;
    datas += QString("{").toAscii();
    datas += QString(QString("\"body\": \"") + m_TmpBody + "\"").toAscii();
    datas += QString("}").toAscii();

    QNetworkRequest request(url);
    request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
    request.setRawHeader("Authorization", (QString("token ") + GITHUB_ACCESS_TOKEN).toAscii());


    QNetworkReply* reply = m_NetworkAccessManager->post(request, datas);
    bool ok = connect(reply, SIGNAL(finished()), this, SLOT(checkReplyInsertComment()));
    Q_ASSERT(ok);
    Q_UNUSED(ok);
}
开发者ID:amonchakai,项目名称:Gh10,代码行数:35,代码来源:BugReportController.cpp

示例2: onPromptFinishedShareFile

void DriveController::onPromptFinishedShareFile(bb::system::SystemUiResult::Type result) {
    using namespace bb::cascades;
    using namespace bb::system;

    qDebug() << "onPromptFinishedShareFile " << result;

    if(result == bb::system::SystemUiResult::ConfirmButtonSelection) {
        SystemDialog* prompt = qobject_cast<SystemDialog*>(sender());
        if(prompt != NULL) {

            QString url;
            m_Mutex.lockForRead();
            for(int i = 0 ; i < m_DriveItems.length() ; ++i)
                if(m_DriveItems.at(i)->getID() == m_SelectedItemForSharing) {
                    url = m_DriveItems.at(i)->getOpenLink();
                    break;
                }
            m_Mutex.unlock();

            m_Google->shareId(m_SelectedItemForSharing, url);

            prompt->deleteLater();
        }
    }
}
开发者ID:Jendorski,项目名称:Hg10,代码行数:25,代码来源:DriveController.cpp

示例3: onSslErrors

void NetImageManager::onSslErrors(QNetworkReply * reply,
		const QList<QSslError> & errors) {

	foreach (QSslError e, errors)
        qDebug() << "SSL error: " << e;



    SystemDialog *dialog = new SystemDialog("OK");

     dialog->setTitle(tr("SSL errors received"));
     dialog->setBody(tr("We have received information about a security breach in the protocol. Press \"OK\" to terminate the application"));


     // Connect your functions to handle the predefined signals for the buttons.
     // The slot will check the SystemUiResult to see which button was clicked.

     bool success = connect(dialog,
         SIGNAL(finished(bb::system::SystemUiResult::Type)),
         this,
         SLOT(onDialogFinished(bb::system::SystemUiResult::Type)));

     if (success) {
         // Signal was successfully connected.
         // Now show the dialog box in your UI

         dialog->show();
     } else {
         // Failed to connect to signal.
         dialog->deleteLater();
     }

}
开发者ID:13natty,项目名称:Cascades-Samples,代码行数:33,代码来源:netimagemanager.cpp

示例4: insertComment

void BugReportController::insertComment(const QString &body, int issueNumber) {
    // get the list of issues
    m_TmpBody = body;
    m_TmpLabel = issueNumber;

    if(body.isEmpty()) {
        bb::system::SystemToast *toast = new bb::system::SystemToast(this);

        toast->setBody(tr("A comment should not be empty."));
        toast->setPosition(bb::system::SystemUiPosition::MiddleCenter);
        toast->show();
        return;

    }

    using namespace bb::cascades;
    using namespace bb::system;

    SystemDialog *dialog = new SystemDialog("Yes", "No");

    dialog->setTitle(tr("Create a new comment"));
    dialog->setBody(tr("Do you want to submit this comment? Please make sure that the content of the message is anonymous."));

    bool success = connect(dialog,
         SIGNAL(finished(bb::system::SystemUiResult::Type)),
         this,
         SLOT(onPromptFinishedCreateComment(bb::system::SystemUiResult::Type)));

    if (success) {
        dialog->show();
    } else {
        dialog->deleteLater();
    }
}
开发者ID:amonchakai,项目名称:Gh10,代码行数:34,代码来源:BugReportController.cpp

示例5: deleteRecord

void BalanceController::deleteRecord(int id) {
    using namespace bb::cascades;
    using namespace bb::system;

    SystemDialog *dialog = new SystemDialog("Yes", "No");

    dialog->setTitle(tr("Delete record"));
    dialog->setBody(tr("Are you sure you want to delete this record? "));

    bool success = connect(dialog,
         SIGNAL(finished(bb::system::SystemUiResult::Type)),
         this,
         SLOT(onPromptFinishedDeleteRecord(bb::system::SystemUiResult::Type)));

    if (success) {
        m_tmp_id = id;
        // Signal was successfully connected.
        // Now show the dialog box in your UI.
        dialog->show();
    } else {
        // Failed to connect to signal.
        // This is not normal in most cases and can be a critical
        // situation for your app! Make sure you know exactly why
        // this has happened. Add some code to recover from the
        // lost connection below this line.
        dialog->deleteLater();
    }
}
开发者ID:amonchakai,项目名称:Workout,代码行数:28,代码来源:BalanceController.cpp

示例6: openForSharing

void DriveController::openForSharing(const QString &id, const QString &type) {

    // ----------------------------------------------------------------------------------------------
    // get the dataModel of the listview if not already available
    using namespace bb::cascades;

    if(m_ListView == NULL) {
        qWarning() << "did not received the listview. quit.";
        return;
    }

    GroupDataModel* dataModel = dynamic_cast<GroupDataModel*>(m_ListView->dataModel());

    if(type == "application/vnd.google-apps.folder") {
        if(dataModel != NULL)
            dataModel->clear();

        m_Google->getFileList(id);
    } else {
        using namespace bb::cascades;
        using namespace bb::system;

        SystemDialog *dialog = new SystemDialog("Yes", "No");

        dialog->setTitle("Share");
        dialog->setBody("Do you want to share this document?");

        bool success = connect(dialog,
             SIGNAL(finished(bb::system::SystemUiResult::Type)),
             this,
             SLOT(onPromptFinishedShareFile(bb::system::SystemUiResult::Type)));

        if (success) {
            // Signal was successfully connected.
            // Now show the dialog box in your UI.
            m_SelectedItemForSharing = id;
            dialog->show();
        } else {
            // Failed to connect to signal.
            // This is not normal in most cases and can be a critical
            // situation for your app! Make sure you know exactly why
            // this has happened. Add some code to recover from the
            // lost connection below this line.
            dialog->deleteLater();
        }

    }

}
开发者ID:Jendorski,项目名称:Hg10,代码行数:49,代码来源:DriveController.cpp

示例7: showDialog

// A public function to display a SystemDialog in your UI
void ApplicationUI::showDialog()
{

    // Set up the SystemDialog with a title and some body text.
    // Label the two standard buttons with specific text.
    // Add a custom button as well.

    SystemDialog *dialog = new SystemDialog("Save as",
                                            "Discard changes",
                                            "Cancel");

    dialog->setTitle("Save changes");

    dialog->setBody("Save your changes and close the document?");

    dialog->setEmoticonsEnabled(true);

    // Connect the finished() signal to the onDialogFinished() slot.
    // The slot will check the SystemUiResult to see which
    // button was tapped.

    bool success = connect(dialog,
         SIGNAL(finished(bb::system::SystemUiResult::Type)),
         this,
         SLOT(onDialogFinished(bb::system::SystemUiResult::Type)));

    if (success) {
        // Signal was successfully connected.
        // Now show the dialog box in your UI.

        dialog->show();
    } else {
        // Failed to connect to signal.
        // This is not normal in most cases and can be a critical
        // situation for your app! Make sure you know exactly why
        // this has happened. Add some code to recover from the
        // lost connection below this line.
        dialog->deleteLater();
    }
}
开发者ID:icetingyu,项目名称:ButtonAlert_QML_CPP,代码行数:41,代码来源:applicationui.cpp


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