void DatabaseWidget::addDataToDatabaseInit() { FormDialog fDialog(this, FormDialog::AddingRecord, "Numer wtryskiwacza:") ; fDialog.exec() ; if (fDialog.canceled) return ; QString filePathName(QDir::currentPath() + "/DatabaseSx/" + fDialog.company + '/' + fDialog.type + '/' + fDialog.number + ".txt"); QFile file(filePathName); if (file.exists() ) { QMessageBox::warning(this, "Błąd", "Nastawy do tego wtryskiwacza już istnieją w bazie.") ; return ; } if(dataWidget) { stackedWidget->removeWidget(dataWidget); delete dataWidget; dataWidget = nullptr; } const QString title(fDialog.company + " - " + fDialog.type + " - " + fDialog.number); dataWidget =new DataWidget(stackedWidget, title, QStringList(), filePathName); stackedWidget->addWidget(DATA_WIDGET, dataWidget); stackedWidget->slideInIdx(DATA_WIDGET); connect(dataWidget, SIGNAL(dialogClosed()), this, SLOT(addDataToDatabaseClosed())); }
void DialogController::closeDialog() { QWidget *dialog = m_dialog; m_dialog = nullptr; m_widget = nullptr; if(!dialog) return; QRect geom = dialog->geometry(); int w = geom.width() + m_dialogOffsetLeft; QPropertyAnimation *animation = new QPropertyAnimation(dialog, "geometry"); animation->setStartValue(visibleGeometry(dialog)); animation->setEndValue(hiddenGeometry(dialog)); animation->setDuration(300); animation->setEasingCurve(QEasingCurve::OutExpo); animation->start(); connect(animation, &QPropertyAnimation::finished, [=]{ animation->deleteLater(); dialog->close(); dialog->deleteLater(); }); emit dialogClosed(); }
void ViewportQLabel::free_window() { if(display_window != NULL) { QObject::disconnect(display_window,SIGNAL(dialogClosed()),this,SLOT(free_window())); delete display_window; display_window = NULL; } }
void StelDialogLogBook::close() { setVisible(false); StelMainView::getInstance().scene()->setActiveWindow(0); ((QGraphicsWidget*)StelMainView::getInstance().getStelAppGraphicsWidget())->setFocus(Qt::OtherFocusReason); emit(dialogClosed(this)); }
KinectRecorderWindow::KinectRecorderWindow(int fps, KinectDevice* device) : QMainWindow() , fps_(fps) , device_(device) , widget_viewer_(new KinectViewerWidget(fps, device)) { widget_viewer_->setMinimumSize(1280, 480); widget_viewer_->setMaximumSize(1280, 480); setCentralWidget(widget_viewer_); QDockWidget *dock = new QDockWidget(this); dock->setAllowedAreas(Qt::BottomDockWidgetArea); dock->setFeatures(QDockWidget::NoDockWidgetFeatures); widget_record_ = new RecordInterfaceWidget(dock); connect(widget_record_, SIGNAL(dialogOpened()), widget_viewer_, SLOT(pause())); connect(widget_record_, SIGNAL(dialogClosed()), widget_viewer_, SLOT(resume())); connect(widget_record_, SIGNAL(destroyed(QObject*)), this, SLOT(close())); connect(widget_record_, SIGNAL(startRecord(std::string)), this, SLOT(recordStarted(std::string))); connect(widget_record_, SIGNAL(finishRecord()), this, SLOT(recordFinished())); widget_record_->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); dock->setWidget(widget_record_); addDockWidget(Qt::BottomDockWidgetArea, dock); setWindowTitle("Kinect viewer"); move(100, 100); setAttribute(Qt::WA_DeleteOnClose); }
void DataWidget::saveData() { if(!data.isEmpty()) data.clear(); for(int i = 0; i < 5; i++) { for(int j = 0; j < 8; j++) { const QString objectName = QString("editl%1").arg(i+1) + QString("u%1").arg(j+1); QLineEdit* lineEdit = this->findChild<QLineEdit*>( objectName, Qt::FindChildrenRecursively); const QString text = lineEdit->text(); if(text.isEmpty()) data.append("0"); else data.append(text); } } fillUiFromSList(data); bool showError = false; for(int i = 0; i < 5; i++) { const QString objectName1_1 = QString("editl%1u5").arg(i+1); QLineEdit* lineEdit1_1 = this->findChild<QLineEdit*>( objectName1_1, Qt::FindChildrenRecursively); const QString objectName1_2 = QString("editl%1u6").arg(i+1); QLineEdit* lineEdit1_2 = this->findChild<QLineEdit*>( objectName1_2, Qt::FindChildrenRecursively); const QString objectName2_1 = QString("editl%1u7").arg(i+1); QLineEdit* lineEdit2_1 = this->findChild<QLineEdit*>( objectName2_1, Qt::FindChildrenRecursively); const QString objectName2_2 = QString("editl%1u8").arg(i+1); QLineEdit* lineEdit2_2 = this->findChild<QLineEdit*>( objectName2_2, Qt::FindChildrenRecursively); if((lineEdit1_1->text() == "0" && lineEdit1_2->text() == "0") || (lineEdit2_1->text() == "0" && lineEdit2_2->text() == "0")) continue; if(lineEdit1_1->text().toInt() > lineEdit1_2->text().toInt() || lineEdit2_1->text().toInt() > lineEdit2_2->text().toInt()) showError = true; } if(showError) { QMessageBox::warning(this, "Błąd", "Wartość \"od\" musi być większa niż wartość \"do\"."); return; } if(!inputData.empty()) inputData.clear(); stackedWidget->slideInIdx(DATABASE_WIDGET); emit dialogClosed(); }
void ExprShortEdit::showDetails(int idx) { _dialog = new ExprDialog(0); _dialog->editor->replaceExtras(*edit->completionModel); _dialog->browser->setApplyOnSelect(_applyOnSelect); _dialog->browser->setSearchPath(_context.c_str(), _searchPath.c_str()); _dialog->browser->expandAll(); _dialog->setExpressionString(getExpressionString()); if (idx >= 0) { _dialog->showEditor(idx); } connect(_dialog, SIGNAL(expressionApplied()), SLOT(expressionApplied())); connect(_dialog, SIGNAL(dialogClosed()), SLOT(dialogClosed())); _dialog->show(); setEnabled(false); }
void EdgedetectDialog::closeEdgedetect() { image.copyTo(*pimage); emit statusChanged(); this->close(); emit dialogClosed(); }
void DataWidget::cancel() { canceled = true ; if(!inputData.empty()) inputData.clear(); stackedWidget->slideInIdx(DATABASE_WIDGET); emit dialogClosed(); }
ArkViewer::ArkViewer(QWidget * parent, Qt::WFlags flags) : KDialog(parent, flags) { setButtons(Close); m_widget = new KVBox(this); m_widget->layout()->setSpacing(10); setMainWidget(m_widget); connect(this, SIGNAL(finished()), SLOT(dialogClosed())); }
/* * XXX - the routine pointed to by "print_line_fcn_p" doesn't get handed lines, * it gets handed bufferfuls. That's fine for "follow_write_raw()" * and "follow_add_to_gtk_text()", but, as "follow_print_text()" calls * the "print_line()" routine from "print.c", and as that routine might * genuinely expect to be handed a line (if, for example, it's using * some OS or desktop environment's printing API, and that API expects * to be handed lines), "follow_print_text()" should probably accumulate * lines in a buffer and hand them "print_line()". (If there's a * complete line in a buffer - i.e., there's nothing of the line in * the previous buffer or the next buffer - it can just hand that to * "print_line()" after filtering out non-printables, as an * optimization.) * * This might or might not be the reason why C arrays display * correctly but get extra blank lines very other line when printed. */ frs_return_t FollowStreamDialog::readFollowStream() { guint32 global_client_pos = 0, global_server_pos = 0; guint32 *global_pos; gboolean skip; GList* cur; frs_return_t frs_return; follow_record_t *follow_record; QElapsedTimer elapsed_timer; elapsed_timer.start(); for (cur = follow_info_.payload; cur; cur = g_list_next(cur)) { if (dialogClosed()) break; follow_record = (follow_record_t *)cur->data; skip = FALSE; if (!follow_record->is_server) { global_pos = &global_client_pos; if(follow_info_.show_stream == FROM_SERVER) { skip = TRUE; } } else { global_pos = &global_server_pos; if (follow_info_.show_stream == FROM_CLIENT) { skip = TRUE; } } QByteArray buffer; if (!skip) { // We want a deep copy. buffer.clear(); buffer.append((const char *) follow_record->data->data, follow_record->data->len); frs_return = showBuffer( buffer.data(), follow_record->data->len, follow_record->is_server, follow_record->packet_num, global_pos); if(frs_return == FRS_PRINT_ERROR) return frs_return; if (elapsed_timer.elapsed() > info_update_freq_) { fillHintLabel(ui->teStreamContent->textCursor().position()); wsApp->processEvents(); elapsed_timer.start(); } } } return FRS_OK; }
void ViewportQLabel::mouseDoubleClickEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton){ const QPixmap *p = this->pixmap(); if(p != NULL) { if(display_window == NULL) { display_window = new ImageWindowDisplay(label,0); QObject::connect(display_window,SIGNAL(dialogClosed()),this,SLOT(free_window())); display_window->show(); } else { display_window->raise(); } display_window->setPixmap(p); } } }
void QQnxFileDialogHelper::exec() { qFileDialogHelperDebug() << Q_FUNC_INFO; // Clear any previous results m_paths.clear(); QEventLoop loop; connect(this, SIGNAL(dialogClosed()), &loop, SLOT(quit())); loop.exec(); if (m_result == QPlatformDialogHelper::Accepted) Q_EMIT accept(); else Q_EMIT reject(); }
int ApplyDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: dialogClosed((*reinterpret_cast< int(*)>(_a[1]))); break; case 1: on_saveImage_clicked(); break; case 2: on_next_clicked(); break; default: ; } _id -= 3; } return _id; }
void MainWindow::houghcheck() { if (!loadCheck()) { return; } savePrevStatus(); if (!houghDlg) { houghDlg = new HoughDialog(cur_img, this); connect(houghDlg, SIGNAL(statusChanged()), this, SLOT(disp_image())); connect(houghDlg, SIGNAL(dialogClosed()), this, SLOT(clean_houghcheck())); } houghDlg->show(); houghDlg->activateWindow(); }
void MainWindow::facedetect() { if (!loadCheck()) { return; } savePrevStatus(); if (!facedetectDlg) { facedetectDlg = new FacedetectDialog(cur_img,this); connect(facedetectDlg, SIGNAL(statusChanged()), this, SLOT(disp_image())); connect(facedetectDlg, SIGNAL(dialogClosed()), this, SLOT(clean_facedetect())); } facedetectDlg->show(); facedetectDlg->activateWindow(); }
void MainWindow::morphology() { if (!loadCheck()) { return; } savePrevStatus(); if (!morphDlg) { morphDlg = new MorphologyDialog(cur_img, this); connect(morphDlg, SIGNAL(statusChanged()), this, SLOT(disp_image())); connect(morphDlg, SIGNAL(dialogClosed()), this, SLOT(clean_morphology())); } morphDlg->show(); morphDlg->activateWindow(); }
bool QQnxFileDialogHelper::handleEvent(bps_event_t *event) { qFileDialogHelperDebug() << Q_FUNC_INFO; // Check dialog event response type (OK vs CANCEL) // CANCEL => index = 0 // OK => index = 1 int index = dialog_event_get_selected_index(event); qFileDialogHelperDebug() << "Index =" << index; if (index == 1) { m_result = QPlatformDialogHelper::Accepted; if (m_acceptMode == QFileDialogOptions::AcceptOpen) { // File open dialog // ###TODO Check that this actually gets multiple paths and cleans up properly char **filePaths = 0; int pathCount = 0; int result = dialog_event_get_filebrowse_filepaths(event, &filePaths, &pathCount); if (result != BPS_SUCCESS) { qWarning() << "Could not get paths from native file dialog"; return false; } for (int i = 0; i < pathCount; ++i) { QString path = QFile::decodeName(filePaths[i]); m_paths.append(QUrl::fromLocalFile(path)); qFileDialogHelperDebug() << "path =" << path; } bps_free(filePaths); } else { // File save dialog const char *filePath = dialog_event_get_filesave_filepath(event); QString path = QFile::decodeName(filePath); qFileDialogHelperDebug() << "path =" << path; m_paths.append(QUrl::fromLocalFile(path)); } } else { // Cancel m_result = QPlatformDialogHelper::Rejected; } Q_EMIT dialogClosed(); return true; }
void MainWindow::bluropt() { if (!loadCheck()) { return; } savePrevStatus(); if (!blurDlg) { blurDlg = new BlurDialog(cur_img, this); connect(blurDlg, SIGNAL(statusChanged()), this, SLOT(disp_image())); connect(blurDlg, SIGNAL(dialogClosed()), this, SLOT(clean_bluropt())); } blurDlg->show(); blurDlg->activateWindow(); }
void ModifyObject::reject () { if (node) { #ifdef DEBUG_GUI std::cout << "GUI>emit endObjectModification(" << node->getName() << ")" << std::endl; #endif emit endObjectModification(node); #ifdef DEBUG_GUI std::cout << "GUI<emit endObjectModification(" << node->getName() << ")" << std::endl; #endif } // else if (data) emit endDataModification(data); emit(dialogClosed(Id_)); deleteLater(); QDialog::reject(); } //When closing a window, inform the parent.
UsersManagerDialog::UsersManagerDialog(UserContainer* userContainer, UserDbInterface *userDb, QWidget *parent):QDialog(parent), ui(new Ui::UsersManager) { this->userContainer = userContainer; this->userDb = userDb; ui->setupUi(this); this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); this->setWindowIcon(QIcon(":/icons/avatar.png")); QObject::connect(ui->addBtn,SIGNAL(clicked()),this,SLOT(addUser())); QObject::connect(ui->userName,SIGNAL(returnPressed()),this,SLOT(addUser())); QObject::connect(ui->deleteBtn,SIGNAL(clicked()),this,SLOT(deleteUser())); QObject::connect(this,SIGNAL(rejected()),this,SLOT(dialogClosed())); updated = false; }
void DatabaseWidget::editDataInit() { FormDialog fDialog(this, FormDialog::SelectingRecord, "Numer wtryskiwacza:") ; fDialog.exec() ; if (fDialog.canceled) return ; const QString filePathName(QDir::currentPath() + "/DatabaseSx/" + fDialog.company + '/' + fDialog.type + '/' + fDialog.number + ".txt"); QFile file(filePathName); if (!file.exists() ) { QMessageBox::critical(this, "Błąd", "Nie udało się wczytać nastaw z bazy. Może nastawy do tego wtryskiwacza nie istnieją?") ; return ; } file.open(QFile::Text | QFile::ReadOnly) ; QTextStream str(&file) ; QStringList SL ; for (int i = 0 ; i < 40 ; i++) { SL.append(str.readLine() ) ; } file.close() ; str.flush() ; if(dataWidget) { stackedWidget->removeWidget(dataWidget); delete dataWidget; dataWidget = nullptr; } const QString title(fDialog.company + " - " + fDialog.type + " - " + fDialog.number); dataWidget =new DataWidget(stackedWidget, title, SL, filePathName); stackedWidget->addWidget(DATA_WIDGET, dataWidget); stackedWidget->slideInIdx(DATA_WIDGET); connect(dataWidget, SIGNAL(dialogClosed()), this, SLOT(editDataClosed())); }
void ModifyObject::accept () { updateValues(); if (node) { #ifdef DEBUG_GUI std::cout << "GUI>emit endObjectModification(" << node->getName() << ")" << std::endl; #endif emit endObjectModification(node); #ifdef DEBUG_GUI std::cout << "GUI<emit endObjectModification(" << node->getName() << ")" << std::endl; #endif } // else if (data) emit endDataModification(data); emit(dialogClosed(Id_)); deleteLater(); QDialog::accept(); } //if closing by using Ok button, update the values
void ResultWidget::save() { canceled = false; stackedWidget->slideInIdx(DATABASE_WIDGET); emit dialogClosed(); }
Thesaurus::Thesaurus() { m_standAlone = false; m_thesProc = new KProcess; m_wnProc = new KProcess; m_dialog = new KDialog(0); m_dialog->setButtons(KDialog::Help | KDialog::Ok | KDialog::Cancel); m_dialog->setDefaultButton(KDialog::Ok); m_dialog->setHelp(QString(), "thesaurus"); m_dialog->resize(600, 400); KConfigGroup cfg = KGlobal::config()->group(""); m_dataFile = cfg.readEntry("datafile"); if (m_dataFile.isEmpty()) m_dataFile = KGlobal::dirs()->findResource("data", "koffice/thesaurus/thesaurus.txt"); setCaption(); m_noMatch = i18n("(No match)"); m_historyPos = 1; QWidget *page = new QWidget(); m_dialog->setMainWidget(page); QVBoxLayout *topLayout = new QVBoxLayout(page); topLayout->setMargin(KDialog::marginHint()); topLayout->setSpacing(KDialog::spacingHint()); QHBoxLayout *row1 = new QHBoxLayout; topLayout->addLayout(row1); m_edit = new KHistoryComboBox(page); QLabel editLabel(i18n("&Search for:"), page); editLabel.setBuddy(m_edit); m_search = new KPushButton(i18n("S&earch"), page); connect(m_search, SIGNAL(clicked()), this, SLOT(slotFindTerm())); row1->addWidget(&editLabel, 0); row1->addWidget(m_edit, 1); row1->addWidget(m_search, 0); m_back = new QToolButton(page); m_back->setIcon(KIcon(QString::fromLatin1("go-previous"))); m_back->setToolTip(i18nc("@action:button Go back to the previous word in history", "Back")); row1->addWidget(m_back, 0); m_forward = new QToolButton(page); m_forward->setIcon(KIcon(QString::fromLatin1("go-next"))); m_forward->setToolTip(i18nc("@action:button Go forward to the next word in history", "Forward")); row1->addWidget(m_forward, 0); KPushButton *lang = new KPushButton(i18n("Change Language..."), page); connect(lang, SIGNAL(clicked()), this, SLOT(slotChangeLanguage())); row1->addWidget(lang, 0); connect(m_back, SIGNAL(clicked()), this, SLOT(slotBack())); connect(m_forward, SIGNAL(clicked()), this, SLOT(slotForward())); m_tabWidget = new KTabWidget(page); topLayout->addWidget(m_tabWidget); // // Thesaurus Tab // QWidget *thesWidget = new QWidget(m_tabWidget); m_tabWidget->addTab(thesWidget, i18n("&Thesaurus")); QHBoxLayout *thesLayout = new QHBoxLayout; thesLayout->setSpacing(KDialog::spacingHint()); thesWidget->setLayout(thesLayout); QGroupBox *synGroupBox = new QGroupBox(i18n("Synonyms"), thesWidget); QHBoxLayout *synLayout = new QHBoxLayout(); synGroupBox->setLayout(synLayout); m_synListWidget = new QListWidget(synGroupBox); synLayout->addWidget(m_synListWidget); thesLayout->addWidget(synGroupBox); QGroupBox *hyperGroupBox = new QGroupBox(i18n("More General Words"), thesWidget); QHBoxLayout *hyperLayout = new QHBoxLayout(); hyperGroupBox->setLayout(hyperLayout); m_hyperListWidget = new QListWidget(hyperGroupBox); hyperLayout->addWidget(m_hyperListWidget); thesLayout->addWidget(hyperGroupBox); QGroupBox *hypoGroupBox = new QGroupBox(i18n("More Specific Words"), thesWidget); QHBoxLayout *hypoLayout = new QHBoxLayout(); hypoGroupBox->setLayout(hypoLayout); m_hypoListWidget = new QListWidget(hypoGroupBox); hypoLayout->addWidget(m_hypoListWidget); thesLayout->addWidget(hypoGroupBox); // single click -- keep display unambiguous by removing other selections: connect(m_synListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(slotSetReplaceTermSyn(QListWidgetItem *))); connect(m_hyperListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(slotSetReplaceTermHyper(QListWidgetItem *))); connect(m_hypoListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(slotSetReplaceTermHypo(QListWidgetItem *))); // double click -- set the double clicked item as the new search term connect(m_synListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(slotFindTermFromList(QListWidgetItem *))); connect(m_hyperListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(slotFindTermFromList(QListWidgetItem *))); connect(m_hypoListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(slotFindTermFromList(QListWidgetItem *))); // // WordNet Tab // QWidget *wnWidget = new QWidget(m_tabWidget); m_tabWidget->addTab(wnWidget, i18n("&Wordnet")); QVBoxLayout *wnLayout = new QVBoxLayout; wnLayout->setSpacing(KDialog::spacingHint()); wnLayout->setMargin(KDialog::marginHint()); wnWidget->setLayout(wnLayout); m_wnComboBox = new KComboBox(wnWidget); m_wnComboBox->setEditable(false); wnLayout->addWidget(m_wnComboBox); connect(m_wnComboBox, SIGNAL(activated(int)), this, SLOT(slotFindTerm())); m_resultTextBrowser = new KTextBrowser(wnWidget); m_resultTextBrowser->setReadOnly(true); connect(m_resultTextBrowser, SIGNAL(anchorClicked(const QUrl &)), this, SLOT(slotFindTermFromUrl(const QUrl &))); wnLayout->addWidget(m_resultTextBrowser); // Connect for the history box m_edit->setTrapReturnKey(true); // Do not use Return as default key... connect(m_edit, SIGNAL(returnPressed()), this, SLOT(slotFindTerm())); connect(m_edit, SIGNAL(activated(int)), this, SLOT(slotGotoHistory(int))); QHBoxLayout *row2 = new QHBoxLayout( /*m_top_layout*/ ); topLayout->addLayout(row2); m_replaceLineEdit = new KLineEdit(page); m_replaceLabel = new QLabel(i18n("&Replace with:"), page); m_replaceLabel->setBuddy(m_replaceLineEdit); row2->addWidget(m_replaceLabel, 0); row2->addWidget(m_replaceLineEdit, 1); // Set focus m_edit->setFocus(); updateNavButtons(); connect(m_dialog, SIGNAL(accepted()), this, SLOT(process())); connect(m_dialog, SIGNAL(rejected()), this, SLOT(dialogClosed())); }
void DatabaseWidget::closeDialog() { stackedWidget->slideInIdx(MENU_WIDGET); emit dialogClosed(); }
void DatabaseWidget::deleteDataFromDatabase() { FormDialog fDialog(this, FormDialog::SelectingRecord, "Numer wtryskiwacza:") ; fDialog.exec() ; if (fDialog.canceled) return ; QFile file(QDir::currentPath() + "/DatabaseSx/" + fDialog.company + '/' + fDialog.type + '/' + fDialog.number + ".txt") ; if(file.remove()) QMessageBox::information(this, "Sukces", "Nastawy zostały pomyślnie usunięte z bazy danych.") ; else QMessageBox::critical(this, "Błąd", "Nie udało się usunąć nastaw z bazy. Może nastawy \ do tego wtryskiwacza nigdy nie istniały?") ; } void DatabaseWidget::showResult() { FormDialog dialog(this, FormDialog::SelectingRecord, "Nazwa rekordu:") ; dialog.exec() ; if (dialog.canceled) return ; QFile dbFile; QFile dbResFile; dbFile.setFileName(QDir::currentPath() + "/DatabaseSx/" + dialog.company + "/" + dialog.type + "/" + dialog.number + ".txt"); dbResFile.setFileName(QDir::currentPath() + "/DatabaseSx/" + dialog.company + "/" + dialog.type + "/Results/" + dialog.number + ".txt"); if(!dbFile.exists() || !dbResFile.exists()) { QMessageBox::warning(this, "Wynik" , "Wynik o podanej nazwie nie istnieje w bazie danych."); return; } QStringList dbFileSL ; {//read from file dbFile.open(QFile::Text | QFile::ReadOnly) ; QTextStream str(&dbFile) ; for (int i = 0 ; i < 40 ; i++) dbFileSL.append(str.readLine() ) ; dbFile.close() ; } QStringList dbResFileSL; {//read from file dbResFile.open(QFile::Text | QFile::ReadOnly) ; QTextStream str(&dbResFile) ; for (int i = 0 ; i < 100 ; i++) dbResFileSL.append(str.readLine() ) ; dbResFile.close() ; } if(showResultWiget) { stackedWidget->removeWidget(showResultWiget); delete showResultWiget; showResultWiget = nullptr; } const QString hwName = dialog.company + "-" + dialog.type + "-" + dialog.number; showResultWiget =new ResultWidget(stackedWidget, dbFileSL, dbResFileSL, hwName, SHOW_ONLY); stackedWidget->addWidget(SHOWRESULT_WIDGET, showResultWiget); stackedWidget->slideInIdx(SHOWRESULT_WIDGET); } void DatabaseWidget::editResultInit() { FormDialog dialog(this, FormDialog::SelectingRecord, "Nazwa rekordu:") ; dialog.exec() ; if (dialog.canceled) return ; QFile dbFile; QFile dbResFile; dbFile.setFileName(QDir::currentPath() + "/DatabaseSx/" + dialog.company + "/" + dialog.type + "/" + dialog.number + ".txt"); dbResFile.setFileName(QDir::currentPath() + "/DatabaseSx/" + dialog.company + "/" + dialog.type + "/Results/" + dialog.number + ".txt"); if(!dbFile.exists() || !dbResFile.exists()) { QMessageBox::warning(this, "Wynik" , "Wynik o podanej nazwie nie istnieje w bazie danych."); return; } QStringList dbFileSL ; {//read from file dbFile.open(QFile::Text | QFile::ReadOnly) ; QTextStream str(&dbFile) ; for (int i = 0 ; i < 40 ; i++) dbFileSL.append(str.readLine() ) ; dbFile.close() ; } QStringList dbResFileSL; {//read from file dbResFile.open(QFile::Text | QFile::ReadOnly) ; QTextStream str(&dbResFile) ; for (int i = 0 ; i < 100 ; i++) dbResFileSL.append(str.readLine() ) ; dbResFile.close() ; } if(showResultWiget) { stackedWidget->removeWidget(showResultWiget); delete showResultWiget; showResultWiget = nullptr; } const QString hwName = dialog.company + "-" + dialog.type + "-" + dialog.number; showResultWiget =new ResultWidget(stackedWidget, dbFileSL, dbResFileSL, hwName, EDIT); stackedWidget->addWidget(SHOWRESULT_WIDGET, showResultWiget); stackedWidget->slideInIdx(SHOWRESULT_WIDGET); connect(showResultWiget, SIGNAL(dialogClosed()), this, SLOT(editResultClosed())); }
mNotesEditorPluginLoader->instance()); NotesEditorInterface* interface = qobject_cast<NotesEditorInterface*>(plugin); interface->edit(mAgendaEntry, mOwner->mAgendaUtil); connect( interface, SIGNAL(editingCompleted(bool)), this, SLOT(handleNoteEditorClosed(bool))); } else { // Launch the calendar entry editor using calendar editor api mCalenEditor = new CalenEditor(mOwner->mAgendaUtil, this); connect(mCalenEditor, SIGNAL(dialogClosed()), this, SLOT(handleCalendarEditorClosed())); mCalenEditor->edit(mAgendaEntry, false); mCalenEditorClosed = false; } OstTraceFunctionExit0( AGENDAEVENTVIEW_EDIT_EXIT ); } /*! Deletes the agenda entry. */ void AgendaEventView::deleteAgendaEntry() { OstTraceFunctionEntry0( AGENDAEVENTVIEW_DELETEAGENDAENTRY_ENTRY );
// Catch the close event to emit a signal void AboutWindow::closeEvent( QCloseEvent* e ) { e->accept(); emit dialogClosed(); }
void Servers::closeEvent(QCloseEvent *event) { emit dialogClosed(); event->accept(); }