// ---------------------------------------------------- void QucsLib::slotSearchComponent() { SearchDialog *d = new SearchDialog(this); d->setCaption(tr("Search Library Component")); if(d->exec() == QDialog::Accepted) QMessageBox::information(this, tr("Result"), tr("No appropriate component found.")); }
QString SearchDialog::useSearchDialog(QWidget *parent, const QString &srchString) { SearchDialog *sdlg = new SearchDialog(parent, srchString); sdlg->setModal(true); QString result; if (sdlg->exec() == QDialog::Accepted) { result = sdlg->lineEdit->text(); } return result; }
void PhonebookForm::onSearchButtonClicked() { SearchDialog dlg; dlg.exec(); if (dlg.getResult() == SearchDialogResult::ok) { std::map<std::string, std::string> parameters; parameters["name"] = dlg.getName(); parameters["surname"] = dlg.getSurname(); parameters["address"] = dlg.getAddress(); parameters["city"] = dlg.getCity(); parameters["phone"] = dlg.getPhone(); parameters["mobile"] = dlg.getMobile(); parameters["email"] = dlg.getEmail(); emit searchPhones(parameters); } }
void EditAppointmentWid::onAddLinks() { SearchDialog *sd; switch(category_e->currentIndex()) { case 0: sd = new SearchDialog(path+"/",Engine::SYMPTOM_F,model,this); break; case 1: sd = new SearchDialog(path+ "/",Engine::DRUG_F,model,this); break; case 2: sd = new SearchDialog(path+"/",Engine::SURGERY_F,model,this); break; case 3: sd = new SearchDialog(path+"/",Engine::INVESTIGATION_F,model,this); break; default: qDebug("Not possible"); } sd->exec(); }