void frCurveContainer::opCurves::unRef(sU32 curveID) { curveMapIt it = m_curves.find(curveID); if (it != m_curves.end()) { if (--it->second.refs == 0) deleteCurve(curveID); } }
void CQPlotSubwidget::deleteCurves() { mLastSelection.clear(); for (int i = mpListPlotItems->count(); i >= 0; --i) { deleteCurve(i); } mList.clear(); mpListPlotItems->clear(); mLastSelection.clear(); }
void CQPlotSubwidget::removeCurve() { QList<QListWidgetItem *> selection = mpListPlotItems->selectedItems(); if (selection.size() == 0) return; if (QMessageBox::question(this, "Delete Curves", QString("Do you really want to delete the %1 selected curve(s)?").arg(selection.size()), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { for (int index = selection.size() - 1; index >= 0; --index) { deleteCurve(selection.at(index)); } mLastSelection.clear(); } }
void CQPlotSubwidget::deleteCurve(int index) { QListWidgetItem *item = mpListPlotItems->item(index); deleteCurve(item); }
/** * 隧道管理界面类实现 * 继承自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())); }