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


C++ QDialog类代码示例

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


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

示例1: QDialog

/*
  *点击“关于”执行此函数
  *弹出对话框
  */
void Game_main::about()
{
    QDialog *Dblack = new QDialog();
    QVBoxLayout *vlayout = new QVBoxLayout;
    Dblack->setFixedSize(300,280);
    QLabel *label = new QLabel("Copy Right @ UESTC-CCSE wytk2008.net");
    QAbstractButton *bExit = new QPushButton("back");
    vlayout->addWidget(label);
    vlayout->addWidget(bExit);
    Dblack->setLayout(vlayout);
    Dblack->show();
    Dblack->connect(bExit,SIGNAL(clicked()),Dblack,SLOT(close()));
}
开发者ID:yongjunlee,项目名称:connect-six,代码行数:17,代码来源:game_main.cpp

示例2: slotAuthenticationRequired

void DownloadDialog::slotAuthenticationRequired(const QString &hostName, quint16, QAuthenticator *authenticator)
{
    QDialog dlg;
    Ui_DlgAuthorization ui;
    ui.setupUi(&dlg);
    dlg.adjustSize();
    ui.siteDescription->setText(tr("%1 at %2").arg(authenticator->realm()).arg(hostName));

    if (dlg.exec() == QDialog::Accepted) {
        authenticator->setUser(ui.username->text());
        authenticator->setPassword(ui.password->text());
    }
}
开发者ID:5263,项目名称:FreeCAD,代码行数:13,代码来源:DownloadDialog.cpp

示例3: currentState

void BazaarPlugin::update()
{
    const VCSBase::VCSBasePluginState state = currentState();
    QTC_ASSERT(state.hasTopLevel(), return);

    QDialog dialog;
    Ui::RevertDialog revertUi;
    revertUi.setupUi(&dialog);
    dialog.setWindowTitle(tr("Update"));
    if (dialog.exec() != QDialog::Accepted)
        return;
    m_client->update(state.topLevel(), revertUi.revisionLineEdit->text());
}
开发者ID:NoobSaibot,项目名称:qtcreator-minimap,代码行数:13,代码来源:bazaarplugin.cpp

示例4: displayException

void ExpTranWindow::displayException(const std::exception &e)
{
    QDialog d;
    QVBoxLayout *layout = new QVBoxLayout();
    QTextBrowser *browser = new QTextBrowser;
    QString str = e.what();
    browser->setText(str);
    layout->addWidget(browser);
    d.setLayout(layout);

    d.setWindowTitle("Error");
    d.exec();
}
开发者ID:dem42,项目名称:exp_tran,代码行数:13,代码来源:exptranwindow.cpp

示例5: on_action_Manage_WMS_Connection_triggered

void SWGISBrowser::on_action_Manage_WMS_Connection_triggered()
{
    QDialog *wmsDialog = dynamic_cast<QDialog*>(QgsProviderRegistry::instance()->selectWidget(QString("wms")));
    if(!wmsDialog)
    {
        QMessageBox::warning(this, tr("WMS"), tr("Cannot get WMS select dialog from provider!"));
        return;
    }

    wmsDialog->exec();
    delete wmsDialog;
    this->refresh();
}
开发者ID:LZS1991,项目名称:SWGIS,代码行数:13,代码来源:swgisbrowser.cpp

示例6: main

int main(int argc, char *argv[])
{
	QApplication app(argc, argv);
	QLabel *label = new QLabel("Hello Qt!");
	label->show();
	
	QDialog *dialog = new QDialog();
	Ui_Dialog *ui_dialog = new Ui_Dialog();
	ui_dialog->setupUi(dialog);
	dialog->show();

	return app.exec();
}
开发者ID:TonyLittleBoy,项目名称:Practice,代码行数:13,代码来源:main.cpp

示例7: AboutShow

void MainWindow::AboutShow()
{
    QDialog *aboutDialog = new QDialog;
    QLabel *aboutLabel = new QLabel;
    QString titleString = "关于";
    aboutDialog->setWindowTitle(titleString);
    aboutDialog->setWindowIcon(QIcon("://icon/infoIcon.png"));
    aboutLabel = new QLabel(aboutDialog);
    QPixmap contentPix("://icon/aboutText.png");
    aboutLabel->setPixmap(contentPix);
    aboutLabel->show();
    aboutDialog->exec();
}
开发者ID:lohasbai,项目名称:Picture-Size,代码行数:13,代码来源:mainwindow.cpp

示例8: WarningShow

void MainWindow::WarningShow()
{
    QDialog *warningDialog = new QDialog;
    QLabel *warningLabel = new QLabel;
    QString titleString = "Warning";
    warningDialog->setWindowTitle(titleString);
    warningDialog->setWindowIcon(QIcon("://icon/infoIcon.png"));
    warningLabel = new QLabel(warningDialog);
    QPixmap contentPix("://icon/warningText.png");
    warningLabel->setPixmap(contentPix);
    warningLabel->show();
    warningDialog->exec();
}
开发者ID:lohasbai,项目名称:Picture-Size,代码行数:13,代码来源:mainwindow.cpp

示例9: on_actionHelpAbout_triggered

void MainWindow::on_actionHelpAbout_triggered()
{
    QDialog *aboutDialog = new QDialog;

    Ui::About about;
    about.setupUi(aboutDialog);
    about.versionLabel->setText(
            QString("Version: %1 Revision: %2").arg(version).arg(revision));

    aboutDialog->exec();

    delete aboutDialog;
}
开发者ID:Raman325,项目名称:ostinato,代码行数:13,代码来源:mainwindow.cpp

示例10: main

int main (int argc, char ** argv) {
    QApplication app(argc, argv);
    QDialog * dial = new QDialog();
    QVBoxLayout * mainlayout = new QVBoxLayout(dial);
    mainlayout->addLayout(getInputForm(dial,"firstname"));
    mainlayout->addLayout(getInputForm(dial,"lastname"));
    mainlayout->addLayout(getInputForm(dial,"phone"));
    mainlayout->addLayout(getInputForm(dial,"email"));
    mainlayout->addWidget(new QPushButton("send to db",dial));
    dial->setLayout(mainlayout);
    dial->show();
    return app.exec();
}
开发者ID:bondarevts,项目名称:amse-qt,代码行数:13,代码来源:SimpleUi.cpp

示例11: QDialog

void MainWindow::on_action_Find_triggered()
{
    QDialog *findDlg = new QDialog(this);
    findDlg->setWindowTitle(tr("查找"));
    find_textLineEdit = new QLineEdit(findDlg);
    QPushButton *find_Btn = new QPushButton(tr("查找下一个"),findDlg);
    QVBoxLayout* layout = new QVBoxLayout(findDlg);
    layout->addWidget(find_textLineEdit);
    layout->addWidget(find_Btn);
    findDlg->show();
    connect(find_Btn,SIGNAL(clicked()),this,SLOT(show_findText()));
    second_statusLabel->setText(tr("正在进行查找"));
}
开发者ID:flyi,项目名称:LDE,代码行数:13,代码来源:mainwindow.cpp

示例12: GuideShow

void MainWindow::GuideShow()
{
    QDialog *guideDialog = new QDialog;
    QLabel *guideLabel = new QLabel;
    QString titleString = "使用说明";
    guideDialog->setWindowTitle(titleString);
    guideDialog->setWindowIcon(QIcon("://icon/helpIcon.png"));
    guideLabel = new QLabel(guideDialog);
    QPixmap contentPix("://icon/welcomeText.jpg");
    guideLabel->setPixmap(contentPix);
    guideLabel->show();
    guideDialog->exec();
}
开发者ID:lohasbai,项目名称:Picture-Size,代码行数:13,代码来源:mainwindow.cpp

示例13: showRegExpDialog

void SingleConditionWidget::showRegExpDialog()
{
  QDialog *editorDialog =
    KParts::ComponentFactory::createPartInstanceFromQuery<QDialog>(
      "KRegExpEditor/KRegExpEditor", QString() );
  if ( editorDialog ) {
    KRegExpEditorInterface *editor = qobject_cast<KRegExpEditorInterface *>( editorDialog );
    Q_ASSERT( editor ); // This should not fail!
    editor->setRegExp( expr->text() );
    editorDialog->exec();
    expr->setText( editor->regExp() );
  }
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:13,代码来源:kscoringeditor.cpp

示例14: installAction

void InstallDialog::SlotOkButtonClicked()
{
        Action installAction("org.kde.kcontrol.kcmgrub2.install");
        installAction.setHelperId("org.kde.kcontrol.kcmgrub2");
        for (int i = 0; i < ui->treeWidget_recover->topLevelItemCount(); i++) {
            QRadioButton *radio = qobject_cast<QRadioButton *>(ui->treeWidget_recover->itemWidget(ui->treeWidget_recover->topLevelItem(i), 0));
            if (radio && radio->isChecked()) {
                installAction.addArgument("partition", ui->treeWidget_recover->topLevelItem(i)->text(1));
                installAction.addArgument("mountPoint", ui->treeWidget_recover->topLevelItem(i)->text(2));
                installAction.addArgument("mbrInstall", !ui->checkBox_partition->isChecked());
                break;
            }
        }
        if (installAction.arguments().value("partition").toString().isEmpty()) {
            KMessageBox::sorry(this, i18nc("@info", "Sorry, you have to select a partition with a proper name!"));
            return;
        }


        QProgressDialog progressDlg(this, Qt::Dialog);
        progressDlg.setWindowTitle(i18nc("@title:window", "Installing"));
        progressDlg.setLabelText(i18nc("@info:progress", "Installing GRUB..."));
        progressDlg.setCancelButton(0);
        progressDlg.setModal(true);
        progressDlg.setRange(0,0);
        progressDlg.show();

        ExecuteJob* reply = installAction.execute();
        reply->exec();
        
        if (reply->action().status() != Action::AuthorizedStatus ) {
          progressDlg.hide();
          return;
        }
        
        //connect(reply, SIGNAL(result()), &progressDlg, SLOT(hide()));
        progressDlg.hide();
        if (reply->error()) {
            KMessageBox::detailedError(this, i18nc("@info", "Failed to install GRUB."), reply->data().value("errorDescription").toString());
            this->reject();
        } else {
            progressDlg.hide();
            QDialog *dialog = new QDialog(this, Qt::Dialog);
            dialog->setWindowTitle(i18nc("@title:window", "Information"));
            dialog->setModal(true);
            QDialogButtonBox *btnbox = new QDialogButtonBox(QDialogButtonBox::Ok);
            KMessageBox::createKMessageBox(dialog, btnbox, QMessageBox::Information, i18nc("@info", "Successfully installed GRUB."), QStringList(), QString(), 0, KMessageBox::Notify, reply->data().value("output").toString()); // krazy:exclude=qclasses
            this->accept();
        }
    //this->accept();
}
开发者ID:houzhenggang,项目名称:grub2-editor,代码行数:51,代码来源:installDlg.cpp

示例15: fits_get_errstatus

void FITSTab::headerFITS()
{
    QString recordList;
    int nkeys;
    int err_status;
    char err_text[FLEN_STATUS];

    FITSImage *image_data = image->getImageData();

    if ( (err_status = image_data->getFITSRecord(recordList, nkeys)) < 0)
    {
        fits_get_errstatus(err_status, err_text);
        KMessageBox::error(0, i18n("FITS record error: %1", QString::fromUtf8(err_text)), i18n("FITS Header"));
        return;
    }

    //FIXME: possible crash! Must use QPointer<...>!
    QDialog fitsHeaderDialog;
    Ui::fitsHeaderDialog header;
    header.setupUi(&fitsHeaderDialog);
    header.tableWidget->setRowCount(nkeys);
    for(int i = 0; i < nkeys; i++)
    {
        QString record = recordList.mid(i*80, 80);
        // I love regexp!
        QStringList properties = record.split(QRegExp("[=/]"));

        QTableWidgetItem* tempItem = new QTableWidgetItem(properties[0].simplified());
        tempItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
        header.tableWidget->setItem(i, 0, tempItem);

        if (properties.size() > 1)
        {
            tempItem = new QTableWidgetItem(properties[1].simplified());
            tempItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
            header.tableWidget->setItem(i, 1, tempItem);
        }

        if (properties.size() > 2)
        {
            tempItem = new QTableWidgetItem(properties[2].simplified());
            tempItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
            header.tableWidget->setItem(i, 2, tempItem);
        }

    }

    header.tableWidget->resizeColumnsToContents();
    fitsHeaderDialog.exec();

}
开发者ID:felipebetancur,项目名称:kstars,代码行数:51,代码来源:fitstab.cpp


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