Beispiel #1
62
/*
  *点击“关于”执行此函数
  *弹出对话框
  */
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()));
}
Beispiel #2
18
void NewAccount::addAccountDescription ()
  {
    // Function for adding or editing an account description.
    QDialog *description = new QDialog ( this, "description", TRUE );
    description->setCaption ( "Notes" );
    QMultiLineEdit *enter = new QMultiLineEdit ( description );
    enter->setFixedSize ( ( int ) (this->width() * 0.75 ), ( int ) ( this->height() * 0.5 ) );
    enter->setWrapColumnOrWidth ( ( int ) (this->width() * 0.75 ) );
    enter->setWordWrap ( QMultiLineEdit::WidgetWidth );
    if ( accountdescription != "(NULL)" )
      enter->setText ( accountdescription );
    if ( description->exec () == QDialog::Accepted )
      accountdescription = enter->text ();
  }
Beispiel #3
11
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());
    }
}
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() );
  }
}
Beispiel #5
0
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();
}
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());
}
Beispiel #7
0
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();
}
Beispiel #8
0
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();
}
Beispiel #9
0
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();
}
Beispiel #10
0
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();
}
Beispiel #11
0
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;
}
Beispiel #12
0
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();
}
Beispiel #13
0
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();
}
Beispiel #14
0
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();

}
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();
}
Beispiel #16
0
void RSSManager::editFeed()
{
    QString url = ui->tabWidget->tabToolTip(ui->tabWidget->currentIndex());
    if (url.isEmpty()) {
        return;
    }

    QDialog* dialog = new QDialog(this);
    QFormLayout* layout = new QFormLayout(dialog);
    QLabel* label = new QLabel(dialog);
    QLineEdit* editUrl = new QLineEdit(dialog);
    QLineEdit* editTitle = new QLineEdit(dialog);
    QDialogButtonBox* box = new QDialogButtonBox(dialog);
    box->addButton(QDialogButtonBox::Ok);
    box->addButton(QDialogButtonBox::Cancel);
    connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
    connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));

    label->setText(tr("Fill title and URL of a feed: "));
    layout->addRow(label);
    layout->addRow(new QLabel(tr("Feed title: ")), editTitle);
    layout->addRow(new QLabel(tr("Feed URL: ")), editUrl);
    layout->addRow(box);

    editUrl->setText(ui->tabWidget->tabToolTip(ui->tabWidget->currentIndex()));
    editTitle->setText(ui->tabWidget->tabText(ui->tabWidget->currentIndex()));

    dialog->setWindowTitle(tr("Edit RSS Feed"));
    dialog->setMinimumSize(400, 100);
    dialog->exec();
    if (dialog->result() == QDialog::Rejected) {
        return;
    }

    QString address = editUrl->text();
    QString title = editTitle->text();

    if (address.isEmpty() || title.isEmpty()) {
        return;
    }

    QSqlQuery query;
    query.prepare("UPDATE rss SET address=?, title=? WHERE address=?");
    query.bindValue(0, address);
    query.bindValue(1, title);
    query.bindValue(2, url);
    query.exec();

    refreshTable();

}
void CGraphicBuildingTile::display(QList<QString> _toDisplay)
{
    QDialog* infoDialog = new QDialog;//(dynamic_cast<QWidget*>(this->parent()));
    QVBoxLayout* newLayout = new QVBoxLayout();
    int q=0;
    QScrollArea* scrolArea = new QScrollArea(dynamic_cast<QWidget*>(this->parent()));
    for(int i=0;i<_toDisplay.count();i++)
    {   QLabel* newLabel = new QLabel(_toDisplay.at(i));
        newLabel->setFixedWidth(280);
        newLabel->setMinimumHeight(22);
        newLabel->setStyleSheet("border: 1px solid black");
        newLayout->addWidget(newLabel);
        q++;
    }
    QPalette pal;
    pal.setColor(QPalette::Background,QColor(230,200,167));
    infoDialog->setFixedWidth(330);
    infoDialog->setMinimumHeight(30+22*q);
    infoDialog->setLayout(newLayout);
    infoDialog->setAutoFillBackground(true);
    infoDialog->setPalette(pal);
    infoDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setWidget(infoDialog);
    scrolArea->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setMaximumHeight(infoDialog->size().height()+2);
    scrolArea->setWindowTitle(QString("Info about"));
    scrolArea->show();
}
void BazaarPlugin::revertCurrentFile()
{
    const VCSBase::VCSBasePluginState state = currentState();
    QTC_ASSERT(state.hasFile(), return);

    QDialog dialog;
    Ui::RevertDialog revertUi;
    revertUi.setupUi(&dialog);
    if (dialog.exec() != QDialog::Accepted)
        return;
    m_client->revertFile(state.currentFileTopLevel(),
                         state.relativeCurrentFile(),
                         revertUi.revisionLineEdit->text());
}
Beispiel #19
0
void MeanSquaredErrorOp::operator()(const imagein::Image* image, const std::map<const imagein::Image*, std::string>& imgList) {

    QDialog* dialog = new QDialog();
    dialog->setWindowTitle(qApp->translate("Operations", "Compare to..."));
    dialog->setMinimumWidth(180);
    QFormLayout* layout = new QFormLayout();
    dialog->setLayout(layout);

    QString currentImgName = QString(imgList.find(image)->second.c_str());

    ImageListBox* imageBox = new ImageListBox(dialog, image, imgList);
    layout->insertRow(0, qApp->translate("Operations", "Compare %1 to : ").arg(currentImgName), imageBox);

    QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, Qt::Horizontal, dialog);
    layout->insertRow(1, buttonBox);
    QObject::connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
    QObject::connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject()));

    QDialog::DialogCode code = static_cast<QDialog::DialogCode>(dialog->exec());

    if(code!=QDialog::Accepted) {
        return;
    }

    const Image* sndImg = imageBox->currentImage();
    unsigned int maxWidth = min(image->getWidth(), sndImg->getWidth());
    unsigned int maxHeight = min(image->getHeight(), sndImg->getHeight());
    unsigned int maxChannel = min(image->getNbChannels(), sndImg->getNbChannels());

    double mse = 0, me = 0;
    for(unsigned int c = 0; c < maxChannel; ++c) {
        for(unsigned int j = 0; j < maxHeight; ++j) {
            for(unsigned int i = 0; i < maxWidth; ++i) {
                int deviation = image->getPixel(i, j, c) - sndImg->getPixel(i, j, c);
                mse += deviation*deviation;
                me += abs(deviation);
            }
        }
    }

    mse = mse / static_cast<double>(maxChannel * maxWidth * maxHeight);
    me = me / static_cast<double>(maxChannel * maxWidth * maxHeight);
    QString text = qApp->translate("MeanSquareErrorOp", "Mean squarred error : %1 (mean error : %2)");
    text = text.arg(mse, 0, 'f', 2);
    text = text.arg(me, 0, 'f', 2);

    this->outText(text.toStdString());
    outText("-------------------------------------------");

}
Beispiel #20
0
void MibEditor::Find(void)
{
    QDialog d;

    find_uid.setupUi(&d);
    connect( find_uid.buttonFindNext, SIGNAL( clicked() ), 
             this, SLOT( ExecuteFind() ));
    find_uid.comboFind->setFocus(Qt::TabFocusReason);

    find_uid.comboFind->addItems(find_strings);
    if (!find_string.isEmpty())
        find_uid.comboFind->setCurrentIndex(find_uid.comboFind->findText(find_string));
    d.exec();
}
LVRRemoveOutliersDialog::LVRRemoveOutliersDialog(LVRPointCloudItem* pc, LVRModelItem* parent, QTreeWidget* treeWidget, vtkRenderWindow* window) :
   m_pc(pc), m_parent(parent), m_treeWidget(treeWidget), m_renderWindow(window)
{
    // Setup DialogUI and events
    QDialog* dialog = new QDialog(m_treeWidget);
    m_dialog = new RemoveOutliersDialog;
    m_dialog->setupUi(dialog);

    connectSignalsAndSlots();

    dialog->show();
    dialog->raise();
    dialog->activateWindow();
}
QDialog *PrincipalFormPlugin::dialogFromWidget(QWidget* w)
{
    closeEater *ce = new closeEater;
    w->installEventFilter( ce );

    QDialog *d = new QDialog;
    d->setLayout( new QHBoxLayout );
    d->layout()->addWidget( w );

    QObject::connect( ce,SIGNAL(close()),d,SLOT(close()) );
    QObject::connect( d,SIGNAL(destroyed()),w,SLOT(deleteLater()) );
    QObject::connect( w,SIGNAL(destroyed()),ce,SLOT(deleteLater()) );
    return d;
}
Beispiel #23
0
void MenuButton::mousePressEvent ( QGraphicsSceneMouseEvent * event ) {
    QGraphicsItem::mousePressEvent(event);
    if(event->button() != Qt::LeftButton) return;
    if(currentMenu) {
        currentMenu->setFocus(); //BUG: doesnt seem to work
        return;
    }

    QDialog *menu = new QDialog(panelWindow);
    menu->move(event->screenPos().x(), event->screenPos().y());
    QVBoxLayout *layout = new QVBoxLayout();

    QCheckBox *editModeCheck = new QCheckBox("Edit Panel", menu);
    editModeCheck->setChecked(editMode);
    connect(editModeCheck, SIGNAL(clicked(bool)), panelWindow, SLOT(setEditMode(bool)));
    connect(editModeCheck, SIGNAL(clicked(bool)), this, SLOT(setEditMode(bool)));

    layout->addWidget(editModeCheck);
    QPushButton *addButton = new QPushButton("Add Item", menu);
    connect(addButton, SIGNAL(clicked()), panelWindow, SLOT(addItem()));
    layout->addWidget(addButton);

    QPushButton *saveButton = new QPushButton("Save panel", menu);
    connect(saveButton, SIGNAL(clicked()), panelWindow, SLOT(savePanel()));
    layout->addWidget(saveButton);

    QPushButton *loadButton = new QPushButton("Load panel", menu);
    connect(loadButton, SIGNAL(clicked()), panelWindow, SLOT(loadPanel()));
    layout->addWidget(loadButton);

    QPushButton *settingsButton = new QPushButton("App Settings", menu);
    connect(settingsButton, SIGNAL(clicked()), panelWindow, SLOT(showSettings()));
    connect(settingsButton, SIGNAL(clicked()), this, SLOT(closeCurrentMenu()));
    layout->addWidget(settingsButton);

    QPushButton *closeButton = new QPushButton("Close", menu);
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeCurrentMenu()));
    layout->addWidget(closeButton);

    QPushButton *quitButton = new QPushButton("Quit", menu);
    connect(quitButton, SIGNAL(clicked()), panelWindow, SLOT(quit()));
    layout->addWidget(quitButton);

    currentMenu = menu;
    connect(currentMenu, SIGNAL(finished(int)), this, SLOT(closeCurrentMenu()));

    menu->setLayout(layout);
    menu->setModal(false);
    menu->show();
}
QDialog* ModuleInterface::makeBusquedaDialog(QWidget* form)
{
  QDialog* dialogBuscar =  new QDialog(this);
  QDialogButtonBox* buttons= new QDialogButtonBox();
  buttons->addButton("Buscar",QDialogButtonBox::AcceptRole);
  buttons->addButton("Cancelar",QDialogButtonBox::RejectRole);
  connect(buttons, SIGNAL(accepted()), dialogBuscar, SLOT(accept()));
  connect(buttons, SIGNAL(rejected()), dialogBuscar, SLOT(reject()));
  QGridLayout* layout = new QGridLayout;
  layout->addWidget(form);
  layout->addWidget(buttons);
  dialogBuscar->setLayout(layout);
  return dialogBuscar;
}
Beispiel #25
0
/************
 *
 *功能:帮助操作界面
 *
 *
 *
 **/
void    mainview::helpoperator()
{
    QDialog  *dialog = new  QDialog();
    dialog->setWindowTitle("帮助");
    dialog->resize(800,600);
    //QPushButton  *button_ok  =  new  QPushButton("OK",dialog);
    QWebView   *view = new  QWebView(dialog);
    //view->setGeometry(0,0,800,550);
    //button_ok->setGeometry(550,750,50,50);
    //view->load(QUrl("http://10.3.3.59/index.php?r=help/index"));
    view->load(QUrl("./help.html"));
    //connect(button_ok,SIGNAL(clicked()),dialog,SLOT(close()));
    dialog->exec();
}
void QgsPropertyOverrideButton::showAssistant()
{
  //first step - try to convert any existing expression to a transformer if one doesn't
  //already exist
  if ( !mProperty.transformer() )
  {
    ( void )mProperty.convertToTransformer();
  }

  QgsPanelWidget *panel = QgsPanelWidget::findParentPanel( this );
  QgsPropertyAssistantWidget *widget = new QgsPropertyAssistantWidget( panel, mDefinition, mProperty, mVectorLayer );
  widget->registerExpressionContextGenerator( mExpressionContextGenerator );
  widget->setSymbol( mSymbol ); // we only show legend preview in dialog version

  if ( panel && panel->dockMode() )
  {
    connect( widget, &QgsPropertyAssistantWidget::widgetChanged, this, [this, widget]
    {
      widget->updateProperty( this->mProperty );
      mExpressionString = this->mProperty.asExpression();
      mFieldName = this->mProperty.field();
      updateSiblingWidgets( isActive() );
      this->emit changed();
    } );

    connect( widget, &QgsPropertyAssistantWidget::panelAccepted, this, [ = ] { updateGui(); } );

    panel->openPanel( widget );
    return;
  }
  else
  {
    // Show the dialog version if not in a panel
    QDialog *dlg = new QDialog( this );
    QString key = QStringLiteral( "/UI/paneldialog/%1" ).arg( widget->panelTitle() );
    QgsSettings settings;
    dlg->restoreGeometry( settings.value( key ).toByteArray() );
    dlg->setWindowTitle( widget->panelTitle() );
    dlg->setLayout( new QVBoxLayout() );
    dlg->layout()->addWidget( widget );
    QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
    connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
    connect( buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject );
    connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsPropertyOverrideButton::showHelp );
    dlg->layout()->addWidget( buttonBox );

    if ( dlg->exec() == QDialog::Accepted )
    {
      widget->updateProperty( mProperty );
      mExpressionString = mProperty.asExpression();
      mFieldName = mProperty.field();
      widget->acceptPanel();
      updateSiblingWidgets( isActive() );
      updateGui();

      emit changed();
    }
    settings.setValue( key, dlg->saveGeometry() );
  }
}
Beispiel #27
0
	void UserFilters::on_Paste__released ()
	{
		auto edit = new QPlainTextEdit ();

		QDialog dia (this);
		dia.setWindowTitle (tr ("Paste rules"));
		dia.resize (600, 400);
		dia.setLayout (new QVBoxLayout ());
		dia.layout ()->addWidget (new QLabel (tr ("Paste your custom rules here:")));
		dia.layout ()->addWidget (edit);
		auto box = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
		dia.layout ()->addWidget (box);
		connect (box,
				SIGNAL (accepted ()),
				&dia,
				SLOT (accept ()));
		connect (box,
				SIGNAL (rejected ()),
				&dia,
				SLOT (reject ()));

		if (dia.exec () != QDialog::Accepted)
			return;

		AddMulti (Model_, edit->toPlainText ());
	}
Beispiel #28
0
void RadioView::newStation() {
	QDialog *dia = new QDialog(this);
	Ui_AddRadioDialog *ard = new Ui_AddRadioDialog;
	ard->setupUi(dia);
	ard->addRadioDialogLabel->setPixmap(IconManager::pixmap("addradiodialog", 32));
	dia->resize(300, 100);
	if (dia->exec() == QDialog::Accepted) {
		if (!ard->title->text().isEmpty() && !ard->url->text().isEmpty()) {
			Config::instance()->addRadioStation(ard->title->text(), ard->url->text());
			connected();
		}
	}
	delete dia;
}
void QgsMapToolAnnotation::canvasDoubleClickEvent( QMouseEvent * e )
{
  QgsAnnotationItem* item = itemAtPos( e->posF() );
  if ( !item )
  {
    return;
  }
  QDialog* itemEditor = createItemEditor( item );
  if ( itemEditor )
  {
    itemEditor->exec();
    delete itemEditor;
  }
}
Beispiel #30
-1
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("正在进行查找"));
}