ScreenControl::ScreenControl(QWidget *parent) : QWidget(parent) { setupUi(this); _autoSave=false; _keyColumns=1; _searchType=Query; _shown=false; _listReportName=QString(); _print->setVisible(! _listReportName.isEmpty()); _model = new XSqlTableModel; connect (_new, SIGNAL(clicked()), this, SLOT(newRow())); connect (_save, SIGNAL(clicked()), this, SIGNAL(saveClicked())); connect (_save, SIGNAL(clicked()), this, SLOT(save())); connect (_print, SIGNAL(clicked()), this, SIGNAL(printClicked())); connect (_print, SIGNAL(clicked()), this, SLOT(print())); connect (_prev, SIGNAL(clicked()), this, SLOT(toPrevious())); connect (_next, SIGNAL(clicked()), this, SLOT(toNext())); connect (_search, SIGNAL(clicked()), this, SLOT(search())); connect (_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(enableSave())); _view->setVisible(FALSE); _save->setEnabled(false); _model->setEditStrategy(QSqlTableModel::OnManualSubmit); }
ModelEditDialog::ModelEditDialog(QAbstractItemModel * model, IModelEditPanel * panel, Logbook::Ptr logbook, const QModelIndex & index, QWidget * parent) : QDialog(parent), m_model(model), m_panel(panel), m_logbook(logbook) { m_mapper = new QDataWidgetMapper(this); m_mapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); m_mapper->setModel(m_model); QAbstractItemDelegate * d = m_panel->createDelegate(this); if (d != NULL) m_mapper->setItemDelegate(d); else m_mapper->setItemDelegate(new CustomDelegate(this)); m_btnPrev = new QPushButton(tr("Previous")); m_btnNext = new QPushButton(tr("Next")); //FIXME: HAX so that the search box in MapLocationEditor gets a // returnPressed() event instead of submitting the dialog. m_btnPrev->setDefault(false); m_btnPrev->setAutoDefault(false); m_btnNext->setDefault(false); m_btnNext->setAutoDefault(false); QHBoxLayout * hbox = new QHBoxLayout(); hbox->addStretch(); hbox->addWidget(m_btnPrev); hbox->addWidget(m_btnNext); QWidget * pnl_widget = dynamic_cast<QWidget *>(m_panel); assert(pnl_widget != NULL); QVBoxLayout * vbox = new QVBoxLayout(); vbox->addWidget(pnl_widget); vbox->addLayout(hbox); setLayout(vbox); QAbstractItemModel * m = model; QSortFilterProxyModel * p = dynamic_cast<QSortFilterProxyModel *>(m); while (p != NULL) { m = p->sourceModel(); p = dynamic_cast<QSortFilterProxyModel *>(m); } CustomTableModel * tm = dynamic_cast<CustomTableModel *>(m); if (tm) tm->bind(m_logbook->session()); m_panel->bind(m_logbook->session(), m_mapper); connect(m_btnNext, SIGNAL(clicked()), m_mapper, SLOT(toNext())); connect(m_btnPrev, SIGNAL(clicked()), m_mapper, SLOT(toPrevious())); connect(m_mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(mapperIndexChanged(int))); if (index.isValid()) m_mapper->setCurrentIndex(index.row()); }
//! [Set up widgets] Window::Window(QWidget *parent) : QWidget(parent) { setupModel(); nameLabel = new QLabel(tr("Na&me:")); nameEdit = new QLineEdit(); addressLabel = new QLabel(tr("&Address:")); addressEdit = new QTextEdit(); typeLabel = new QLabel(tr("&Type:")); typeComboBox = new QComboBox(); nextButton = new QPushButton(tr("&Next")); previousButton = new QPushButton(tr("&Previous")); nameLabel->setBuddy(nameEdit); addressLabel->setBuddy(addressEdit); typeLabel->setBuddy(typeComboBox); //! [Set up widgets] //! [Set up the mapper] QSqlTableModel *relModel = model->relationModel(typeIndex); typeComboBox->setModel(relModel); typeComboBox->setModelColumn(relModel->fieldIndex("description")); mapper = new QDataWidgetMapper(this); mapper->setModel(model); mapper->setItemDelegate(new QSqlRelationalDelegate(this)); mapper->addMapping(nameEdit, model->fieldIndex("name")); mapper->addMapping(addressEdit, model->fieldIndex("address")); mapper->addMapping(typeComboBox, typeIndex); //! [Set up the mapper] //! [Set up connections and layouts] connect(previousButton, SIGNAL(clicked()), mapper, SLOT(toPrevious())); connect(nextButton, SIGNAL(clicked()), mapper, SLOT(toNext())); connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(updateButtons(int))); QGridLayout *layout = new QGridLayout(); layout->addWidget(nameLabel, 0, 0, 1, 1); layout->addWidget(nameEdit, 0, 1, 1, 1); layout->addWidget(previousButton, 0, 2, 1, 1); layout->addWidget(addressLabel, 1, 0, 1, 1); layout->addWidget(addressEdit, 1, 1, 2, 1); layout->addWidget(nextButton, 1, 2, 1, 1); layout->addWidget(typeLabel, 3, 0, 1, 1); layout->addWidget(typeComboBox, 3, 1, 1, 1); setLayout(layout); setWindowTitle(tr("SQL Widget Mapper")); mapper->toFirst(); }
//! [Set up widgets] Window::Window(QWidget *parent) : QWidget(parent) { setupModel(); nameLabel = new QLabel(tr("Na&me:")); nameEdit = new QLineEdit(); addressLabel = new QLabel(tr("&Address:")); addressEdit = new QTextEdit(); ageLabel = new QLabel(tr("A&ge (in years):")); ageSpinBox = new QSpinBox(); nextButton = new QPushButton(tr("&Next")); previousButton = new QPushButton(tr("&Previous")); nameLabel->setBuddy(nameEdit); addressLabel->setBuddy(addressEdit); ageLabel->setBuddy(ageSpinBox); //! [Set up widgets] //! [Set up the mapper] mapper = new QDataWidgetMapper(this); mapper->setModel(model); mapper->addMapping(nameEdit, 0); mapper->addMapping(addressEdit, 1); mapper->addMapping(ageSpinBox, 2); connect(previousButton, SIGNAL(clicked()), mapper, SLOT(toPrevious())); connect(nextButton, SIGNAL(clicked()), mapper, SLOT(toNext())); connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(updateButtons(int))); //! [Set up the mapper] //! [Set up the layout] QGridLayout *layout = new QGridLayout(); layout->addWidget(nameLabel, 0, 0, 1, 1); layout->addWidget(nameEdit, 0, 1, 1, 1); layout->addWidget(previousButton, 0, 2, 1, 1); layout->addWidget(addressLabel, 1, 0, 1, 1); layout->addWidget(addressEdit, 1, 1, 2, 1); layout->addWidget(nextButton, 1, 2, 1, 1); layout->addWidget(ageLabel, 3, 0, 1, 1); layout->addWidget(ageSpinBox, 3, 1, 1, 1); setLayout(layout); setWindowTitle(tr("Simple Widget Mapper")); mapper->toFirst(); }
MapData::MapData(QWidget *parent) : QDialog(parent), ui(new Ui::MapData) { ui->setupUi(this); this->setupModel(); mapper = new QDataWidgetMapper(this); mapper->setModel(model); mapper->addMapping(ui->lineEdit,0); mapper->addMapping(ui->plainTextEdit,1); connect(ui->tmbPrev,SIGNAL(clicked()),mapper,SLOT(toPrevious())); connect(ui->tmbNext,SIGNAL(clicked()),mapper,SLOT(toNext())); connect(mapper,SIGNAL(currentIndexChanged(int)),this,SLOT(tombolApdet(int))); mapper->toFirst(); }
SqlItemView::SqlItemView(QWidget * parent) : QWidget(parent), m_row(0), m_changing(false), m_model(0) { setupUi(this); connect(firstButton, SIGNAL(clicked()), this, SLOT(toFirst())); connect(previousButton, SIGNAL(clicked()), this, SLOT(toPrevious())); connect(nextButton, SIGNAL(clicked()), this, SLOT(toNext())); connect(lastButton, SIGNAL(clicked()), this, SLOT(toLast())); connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(aApp_focusChanged(QWidget*,QWidget*))); }
formControl::formControl(QWidget *parent) : QWidget(parent) { setupUi(this); _autoSave=false; _searchType=Query; _shown=false; connect (_new, SIGNAL(clicked()), this, SLOT(newRow())); connect (_save, SIGNAL(clicked()), this, SIGNAL(saveClicked())); connect (_save, SIGNAL(clicked()), this, SLOT(save())); connect (_print, SIGNAL(clicked()), this, SLOT(print())); connect (_prev, SIGNAL(clicked()), this, SLOT(toPrevious())); connect (_next, SIGNAL(clicked()), this, SLOT(toNext())); connect (_search, SIGNAL(clicked()), this, SLOT(search())); //Hiding future functionality that has been commented out for now _print->setVisible(FALSE); _view->setVisible(FALSE); }
/** \fn void EditMediaDialog::makeConnections() * \brief makes the connections used by EditMediaDialog */ void EditMediaDialog::makeConnections() { connect(ui_->nextButton, SIGNAL(clicked()), this, SLOT(toNext())); connect(ui_->previousButton, SIGNAL(clicked()), this, SLOT(toPrevious())); }
EmployeeForm::EmployeeForm(int id, QWidget *parent) : QDialog(parent) { nameEdit = new QLineEdit; nameLabel = new QLabel(tr("Na&me:")); nameLabel->setBuddy(nameEdit); departmentComboBox = new QComboBox; departmentLabel = new QLabel(tr("Depar&tment:")); departmentLabel->setBuddy(departmentComboBox); extensionLineEdit = new QLineEdit; extensionLineEdit->setValidator( new QIntValidator(0, 99999, this)); extensionLabel = new QLabel(tr("E&xtension:")); extensionLabel->setBuddy(extensionLineEdit); emailEdit = new QLineEdit; emailLabel = new QLabel(tr("&Email:")); emailLabel->setBuddy(emailEdit); startDateEdit = new QDateEdit; startDateEdit->setCalendarPopup(true); QDate today = QDate::currentDate(); startDateEdit->setDateRange( today.addDays(-90), today.addDays(90)); startDateLabel = new QLabel(tr("&Start Date:")); startDateLabel->setBuddy(startDateEdit); firstButton = new QPushButton(tr("<< &First")); previousButton = new QPushButton(tr("< &Previous")); nextButton = new QPushButton(tr("&Next >")); lastButton = new QPushButton(tr("&Last >>")); addButton = new QPushButton(tr("&Add")); deleteButton = new QPushButton(tr("&Delete")); closeButton = new QPushButton(tr("&Close")); buttonBox = new QDialogButtonBox; buttonBox->addButton(addButton, QDialogButtonBox::ActionRole); buttonBox->addButton(deleteButton, QDialogButtonBox::ActionRole); buttonBox->addButton(closeButton, QDialogButtonBox::AcceptRole); tableModel = new QSqlRelationalTableModel(this); tableModel->setTable("employee"); tableModel->setRelation(Employee_DepartmentId, QSqlRelation("department", "id", "name")); tableModel->setSort(Employee_Name, Qt::AscendingOrder); tableModel->select(); QSqlTableModel *relationModel = tableModel->relationModel(Employee_DepartmentId); departmentComboBox->setModel(relationModel); departmentComboBox->setModelColumn( relationModel->fieldIndex("name")); mapper = new QDataWidgetMapper(this); mapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); mapper->setModel(tableModel); mapper->setItemDelegate(new QSqlRelationalDelegate(this)); mapper->addMapping(nameEdit, Employee_Name); mapper->addMapping(departmentComboBox, Employee_DepartmentId); mapper->addMapping(extensionLineEdit, Employee_Extension); mapper->addMapping(emailEdit, Employee_Email); mapper->addMapping(startDateEdit, Employee_StartDate); if (id != -1) { for (int row = 0; row < tableModel->rowCount(); ++row) { QSqlRecord record = tableModel->record(row); if (record.value(Employee_Id).toInt() == id) { mapper->setCurrentIndex(row); break; } } } else { mapper->toFirst(); } connect(firstButton, SIGNAL(clicked()), mapper, SLOT(toFirst())); connect(previousButton, SIGNAL(clicked()), mapper, SLOT(toPrevious())); connect(nextButton, SIGNAL(clicked()), mapper, SLOT(toNext())); connect(lastButton, SIGNAL(clicked()), mapper, SLOT(toLast())); connect(addButton, SIGNAL(clicked()), this, SLOT(addEmployee())); connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteEmployee())); connect(closeButton, SIGNAL(clicked()), this, SLOT(accept())); QHBoxLayout *topButtonLayout = new QHBoxLayout; topButtonLayout->setContentsMargins(20, 0, 20, 5); topButtonLayout->addStretch(); topButtonLayout->addWidget(firstButton); topButtonLayout->addWidget(previousButton); topButtonLayout->addWidget(nextButton); topButtonLayout->addWidget(lastButton); topButtonLayout->addStretch(); QGridLayout *mainLayout = new QGridLayout; mainLayout->addLayout(topButtonLayout, 0, 0, 1, 3); mainLayout->addWidget(nameLabel, 1, 0); mainLayout->addWidget(nameEdit, 1, 1, 1, 2); mainLayout->addWidget(departmentLabel, 2, 0); mainLayout->addWidget(departmentComboBox, 2, 1, 1, 2); mainLayout->addWidget(extensionLabel, 3, 0); mainLayout->addWidget(extensionLineEdit, 3, 1); mainLayout->addWidget(emailLabel, 4, 0); mainLayout->addWidget(emailEdit, 4, 1, 1, 2); mainLayout->addWidget(startDateLabel, 5, 0); mainLayout->addWidget(startDateEdit, 5, 1); mainLayout->addWidget(buttonBox, 7, 0, 1, 3); mainLayout->setRowMinimumHeight(6, 10); mainLayout->setRowStretch(6, 1); mainLayout->setColumnStretch(2, 1); setLayout(mainLayout); if (id == -1) { nextButton->setFocus(); } else { nameEdit->setFocus(); } setWindowTitle(tr("Edit Employees")); }
PaymentForm::PaymentForm(QSqlRelationalTableModel *modelCome, int id, QWidget *parent) : QDialog(parent), ui(new Ui::PaymentDialog) { ui->setupUi(this); model = modelCome; QSqlTableModel *relModel = model->relationModel(Payment_Customer_id); ui->customerComboBox->setModel(relModel); ui->customerComboBox->setModelColumn(relModel->fieldIndex("surname")); relModel = model->relationModel(Payment_Work_id - 1); ui->workComboBox->setModel(relModel); ui->workComboBox->setModelColumn(relModel->fieldIndex("name")); ui->priceEdit->setValidator(new QIntValidator(0, 999999, this)); mapper = new QDataWidgetMapper(this); mapper->setModel(model); mapper->addMapping(ui->customerComboBox, Payment_Customer_id); mapper->addMapping(ui->workComboBox, Payment_Work_id - 1); mapper->addMapping(ui->dateEdit, Payment_Date - 1); mapper->addMapping(ui->priceEdit, Payment_Price - 1); mapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); mapper->setItemDelegate(new QSqlRelationalDelegate(this)); if (id != -1) { for (int row = 0; row < model->rowCount(); ++row) { QSqlRecord record = model->record(row); if (record.value(Payment_Payment_id).toInt() == id) { mapper->setCurrentIndex(row); break; } } } else { mapper->toFirst(); } connect(ui->firstButton, SIGNAL(clicked()), mapper, SLOT(toFirst())); connect(ui->previousButton, SIGNAL(clicked()), mapper, SLOT(toPrevious())); connect(ui->nextButton, SIGNAL(clicked()), mapper, SLOT(toNext())); connect(ui->lastButton, SIGNAL(clicked()), mapper, SLOT(toLast())); connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addRecord())); connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteRecord())); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(accept())); connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(updateButtons(int))); connect(ui->workComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateFields(int))); if (id == -1) { ui->nextButton->setFocus(); } else { ui->customerComboBox->setFocus(); } int row = mapper->currentIndex(); updateButtons(row); if (row == -1) { addRecord(); } }
MovimentoEditDialog::MovimentoEditDialog(QSqlRelationalTableModel* model, ColumnIndexes & colInd, int curRow, bool canSubmit, QWidget *parent) : QDialog(parent) , ui(new Ui::MovimentoEditDialog) , m_movModel(model) , m_insert(curRow<0) // se linha < 0, então é inserção, do contrário é edição , m_canSubmit(canSubmit) , m_colInd(colInd) { ui->setupUi(this); if ( m_insert ) ui->movimentoNavGroup->hide(); // se vai inserir, não haverá havegação. // seta as comboBox para que sejam alimentadas pelo relacionamento correspondente // exibindo a coluna "nome" ao inves de "id": // nomes de clientes na respectiva combo: QSqlTableModel *cliRelationModel = m_movModel->relationModel(m_colInd.movClienteId); ui->clienteCombo->setModel(cliRelationModel); ui->clienteCombo->setModelColumn(cliRelationModel->fieldIndex("name")); // como o relation model só duas colunas (chave e valor), poderia: //ui->clienteCombo->setModelColumn(1); // índice da coluna valor ui->clienteCombo->model()->sort(cliRelationModel->fieldIndex("name"), Qt::AscendingOrder); // tipos de movimento na respectiva combo: QSqlTableModel *tipoRelationModel = m_movModel->relationModel(m_colInd.movTipoId); ui->tipoCombo->setModel(tipoRelationModel); ui->tipoCombo->setModelColumn(tipoRelationModel->fieldIndex("name")); ui->tipoCombo->model()->sort(tipoRelationModel->fieldIndex("name"), Qt::AscendingOrder); // * ^^ Nos 2 "relationModel" acima, temos sempre duas colunas: "chave" e "valor associado". // cria um mapeador que relacionará widgets "sem-model" com // as colunas respectivas do model: m_movMapper = new QDataWidgetMapper(this); // "submitPolicy": "auto" ou "manual"; se "auto" irá completar alterações se a linha selecionada for alterada m_movMapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit); // "manual" -> teremos que chamar "submit" no momento apropriado. // define o "model" a ser usado pelo "mapper": m_movMapper->setModel(m_movModel); // define o delegate que permite exibir colunas relacionadas em comboBox's m_movMapper->setItemDelegate(new QSqlRelationalDelegate(this)); // mapeia cada widget necessário para a coluna respectiva no model: m_movMapper->addMapping(ui->clienteCombo, m_colInd.movClienteId); m_movMapper->addMapping(ui->tipoCombo, m_colInd.movTipoId); m_movMapper->addMapping(ui->movDate, m_colInd.movDate); m_movMapper->addMapping(ui->descrEdit, m_colInd.movDescription); // conecta os botões de navegação diretamente aos slots do "mapper" // (neste caso, não é necessário criar novos slots para isso, exceto se quisermos fazer algo diferenciado) if ( !m_insert ) { connect(ui->movimentoNavFirstBtn, SIGNAL(clicked()), m_movMapper, SLOT(toFirst())); connect(ui->movimentoNavPrevBtn, SIGNAL(clicked()), m_movMapper, SLOT(toPrevious())); connect(ui->movimentoNavNextBtn, SIGNAL(clicked()), m_movMapper, SLOT(toNext())); connect(ui->movimentoNavLastBtn, SIGNAL(clicked()), m_movMapper, SLOT(toLast())); } // se for inserir, deve criar nova linha no model if ( m_insert ) // INSERIR { // insere uma nova linha no model (caso o insert seja cancelado, deverá ser removida): curRow = m_movModel->rowCount(); // altera curRow para o total de linhas // rowCount -> total de linhas -> uma nova linha no final: m_movModel->insertRow(curRow); // em inclusão, seta widgets de data (para forçar o default): ui->movDate->setDate( QDate::currentDate() ); setWindowTitle("INCLUIR novo movimento - "); // título do diálogo } else // ALTERAR setWindowTitle("ALTERAR um movimento - "); // título do diálogo QSqlDatabase db = m_movModel->database(); setWindowTitle( windowTitle() + db.driverName()); m_movMapper->setCurrentIndex(curRow); // seta a "row" do mapper // desabilta a opção do menu de sistema "fechar" ("X"); // desse modo só poderá fechar o diálogo com os botões "OK" e "CANCELAR" // e não precisaremos redefinir a virtual "closeEvent" para finalzação Qt::WindowFlags flags = windowFlags(); flags |= Qt::CustomizeWindowHint; // acrescenta: flags customizados flags &= ~Qt::WindowCloseButtonHint; // desabilita: closeButton setWindowFlags(flags); }
/** * 隧道管理界面类实现 * 继承自QWidget * @author fanxiang * @version 1.0.0 * @date 2013-08-18 */ ManageTunnelWidget::ManageTunnelWidget(QWidget *parent) : QWidget(parent), ui(new Ui::ManageTunnelWidget) { ui->setupUi(this); mapper = new QDataWidgetMapper(this); linesModel = NULL; tunnelsModel = NULL; curvesModel = NULL; loadLinesData(); loadTunnelData(); /* 开始选中查找模式为学号模式 */ ui->radioButton->click(); /* 开始不能修改 */ currentRow = 0; changed = false; saveType = Save_Modify; cannotModify(); /* 线路及隧道数据列表更新信号槽 */ connect(ui->linesView, SIGNAL(clicked(QModelIndex)), this, SLOT(updateTunnelsView(const QModelIndex &))); // 【作废】updateCurvesView已在setCurrentMapper中调用 //connect(ui->tunnelsView, SIGNAL(clicked(QModelIndex)), this, SLOT(updateCurvesView(const QModelIndex &))); /* 添加删除隧道槽 */ connect(ui->newTunnelButton, SIGNAL(clicked()), this, SLOT(newTunnel())); connect(ui->deleteTunnelButton, SIGNAL(clicked()), this, SLOT(deleteTunnel())); /* 添加删除隧道对应曲线槽 */ //connect(ui->curvesView, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(changeCurveData())); connect(ui->newCurveButton, SIGNAL(clicked()), this, SLOT(newCurve())); connect(ui->deleteCurveButton, SIGNAL(clicked()), this, SLOT(deleteCurve())); /* 刷新线路隧道 */ connect(ui->refreshButton, SIGNAL(clicked()), this, SLOT(refreshLinesView())); /* 具体隧道信息信号槽 */ connect(ui->tunnelsView, SIGNAL(clicked(QModelIndex)), this, SLOT(showTunnelDetail(const QModelIndex &))); //connect(ui->stumajorcombobox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(updateStuClasses(const QString &))); /* 修改隧道信息信号槽 */ connect(ui->lineEdit_tunnelid, SIGNAL(textChanged(QString)), this, SLOT(canSave())); connect(ui->lineEdit_name, SIGNAL(textChanged(QString)), this, SLOT(canSave())); connect(ui->lineEdit_IDstd, SIGNAL(textChanged(QString)), this, SLOT(canSave())); connect(ui->lineEdit_startPoint, SIGNAL(textChanged(QString)), this, SLOT(canSave())); connect(ui->lineEdit_endPoint, SIGNAL(textChanged(QString)), this, SLOT(canSave())); connect(ui->combobox_isNewLine, SIGNAL(currentIndexChanged(int)), this, SLOT(canSave())); connect(ui->combobox_lineType, SIGNAL(currentIndexChanged(int)), this, SLOT(canSave())); connect(ui->radioButton_isDoubleLine, SIGNAL(clicked()), this, SLOT(canSave())); connect(ui->radioButton_isSingleLine, SIGNAL(clicked()), this, SLOT(canSave())); connect(ui->radioButton_isUpLink, SIGNAL(clicked()), this, SLOT(canSave())); connect(ui->radioButton_isDownLink, SIGNAL(clicked()), this, SLOT(canSave())); connect(ui->radioButton_isBridge, SIGNAL(clicked()), this, SLOT(canSave())); connect(ui->radioButton_notBridge, SIGNAL(clicked()), this, SLOT(canSave())); // 隧道中的曲线界面双击修改后,也可点击保存按钮 connect(ui->curvesView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(canSave())); connect(ui->firstButton, SIGNAL(clicked()), this, SLOT(toFirst())); connect(ui->previousButton, SIGNAL(clicked()), this, SLOT(toPrevious())); connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(toNext())); connect(ui->lastButton, SIGNAL(clicked()), this, SLOT(toLast())); connect(ui->modifyButton, SIGNAL(clicked()), this, SLOT(canModify())); /* 查找隧道槽 */ connect(ui->findButton, SIGNAL(clicked()), this, SLOT(findTunnel())); connect(ui->findEdit,SIGNAL(textEdited(QString)),this,SLOT(showAllLines())); /* 编辑桥梁槽 */ connect(ui->editBridgeClearanceButton, SIGNAL(clicked()), this, SLOT(editBridgeClearance())); }