void CompraBuscar::on_pushButtonEliminar_clicked(){ int row=ui->tableView->selectionModel()->currentIndex().row(); idCompra=model->data(model->index(row,0), Qt::DisplayRole).toString(); if (idCompra!=INVALIDO){ cargarCompra(row); QMessageBox::StandardButton reply; reply=QMessageBox::information(this, "Desea Continuar?" , "Si continua se borrara la COMPRA/PRESTAMO seleccionado PERMANENTEMENTE. \n" "#Socio: "+idSocio+", Socio: "+socio.nombre+" \n" "Prestador: "+prestador.nombre+" \n" "Monto: "+compra.monto+", Cuotas: "+compra.cantcuotas+" \n" "En caso afirmativo se le pedira otra confirmacion" , QMessageBox::Ok|QMessageBox::No); if (reply==QMessageBox::Ok){ reply=QMessageBox::critical(this, "Esta Seguro Que Desea Continuar?" , "Si continua se borrara la COMPRA/PRESTAMO seleccionado PERMANENTEMENTE. \n" "#Socio: "+idSocio+", Socio: "+socio.nombre+" \n" "Prestador: "+prestador.nombre+" \n" "Monto: "+compra.monto+", Cuotas: "+compra.cantcuotas+" \n" , QMessageBox::Ok|QMessageBox::No); if (reply==QMessageBox::Ok){ BD::eliminarCompra(); } } } setTableView(); }
void parsers::on_delParser_clicked() { QModelIndex index = ui->tableView->currentIndex(); if(index.row() != -1){ QMessageBox::StandardButton reply; reply = QMessageBox::question(this, "Remove Parser", "Are you sure you want to remove this parser" + QString(" from the program?") ,QMessageBox::Yes|QMessageBox::No); if(reply == QMessageBox::Yes){ QString data = ui->tableView->model()->data(ui->tableView->model()-> index(index.row(),0)).toString(); QSqlQuery delqry(QString("delete from parser where id = %1").arg(data)); delqry.exec(); setTableView(); } } else { QMessageBox warning; warning.setText("Please select the parser that you'd like to delete!"); warning.setWindowTitle("No Parser Selected"); warning.exec(); } }
parsers::parsers(QWidget *parent) : QDialog(parent), ui(new Ui::parsers) { ui->setupUi(this); setTableView(); }
void parsers::on_addParser_clicked() { AddParser *ap = new AddParser; int retcode = ap->exec(); if(retcode==1) setTableView(); connect(ap,SIGNAL(destroyed()),ap,SLOT(deleteLater())); }
void CompraBuscar::on_pushButtonBuscarSocio_clicked(){ searchSocio = new SocioBuscar(); searchSocio->exec(); if (idSocio!=INVALIDO) socioSeleccionado=true; showNormal(); raise(); activateWindow(); ui->lineEditSocio->setText(socio.nombre+" "+socio.apellido); setTableView(); }
void CompraBuscar::on_pushButtonBuscarPrestador_clicked(){ searchPrestador = new PrestadorBuscar(); searchPrestador->exec(); if (idPrestador!=INVALIDO) prestadorSeleccionado=true; showNormal(); raise(); activateWindow(); ui->lineEditPrestador->setText(prestador.razon_social); setTableView(); }
void OutputWidget::syncWithSettings() { supportedViews curV = SettingsManager::instance().defaultView(); if(curV == Tree){ setTreeView(); } else if(curV == Table){ setTableView(); } else{ setTextView(); } }
OutputWidget::OutputWidget(IServerSPtr server, QWidget* parent) : QWidget(parent) { commonModel_ = new FastoCommonModel(this); VERIFY(connect(commonModel_, &FastoCommonModel::changedValue, server.get(), &IServer::changeValue, Qt::DirectConnection)); VERIFY(connect(server.get(), &IServer::startedChangeDbValue, this, &OutputWidget::startChangeDbValue, Qt::DirectConnection)); VERIFY(connect(server.get(), &IServer::finishedChangeDbValue, this, &OutputWidget::finishChangeDbValue, Qt::DirectConnection)); treeView_ = new FastoTreeView; treeView_->setModel(commonModel_); tableView_ = new FastoTableView; tableView_->setModel(commonModel_); textView_ = new FastoTextView(server->outputDelemitr()); textView_->setModel(commonModel_); textView_->setReadOnly(true); timeLabel_ = new fasto::qt::gui::IconLabel(GuiFactory::instance().timeIcon(), "0", QSize(32, 32)); QVBoxLayout* mainL = new QVBoxLayout; QHBoxLayout* topL = new QHBoxLayout; QSplitter* splitter = new QSplitter; splitter->setOrientation(Qt::Horizontal); splitter->setHandleWidth(1); splitter->setContentsMargins(0, 0, 0, 0); treeButton_ = new QPushButton; tableButton_ = new QPushButton; textButton_ = new QPushButton; treeButton_->setIcon(GuiFactory::instance().treeIcon()); VERIFY(connect(treeButton_, SIGNAL(clicked()), this, SLOT(setTreeView()))); tableButton_->setIcon(GuiFactory::instance().tableIcon()); VERIFY(connect(tableButton_, SIGNAL(clicked()), this, SLOT(setTableView()))); textButton_->setIcon(GuiFactory::instance().textIcon()); VERIFY(connect(textButton_, SIGNAL(clicked()), this, SLOT(setTextView()))); topL->addWidget(treeButton_); topL->addWidget(tableButton_); topL->addWidget(textButton_); topL->addWidget(splitter); topL->addWidget(timeLabel_); mainL->addLayout(topL); mainL->addWidget(treeView_); mainL->addWidget(tableView_); mainL->addWidget(textView_); setLayout(mainL); syncWithSettings(); }
TreasureExploreLayer::~TreasureExploreLayer() { setTitleLabel(NULL); setLabel1(NULL); setLabel2(NULL); setLabel3(NULL); setLabel4(NULL); setLabel5(NULL); setLabel6(NULL); setLabel7(NULL); setCloseBtn(NULL); setExploreBtn(NULL); setGetRewardBtn(NULL); setCurMapName(NULL); setSuccessNum(NULL); setMaterialNum(NULL); setDiamondNum(NULL); setRemainNum(NULL); setProgressTimer(NULL); setRateLayer(NULL); setPercentSprite1(NULL); setPercentSprite2(NULL); setPercentSprite3(NULL); setRateEffectLayer(NULL); setTableView(NULL); setTableViewLayer(NULL); setBgSprite(NULL); setDiamondOwn(NULL); setMaterialOwn(NULL); setLabel8(NULL); setLabel9(NULL); setRefreshBtn(NULL); setLabel10(NULL); setRefreshDiamond(NULL); //setRefreshTimes(NULL); setWordRefresh(NULL); setWordUpgrade(NULL); setBallEffectLayer(NULL); setLabel11(NULL); setLabel12(NULL); setResetTimes(NULL); UIManager::sharedManager()->RemoveLayout("TreasureExploreLayer"); delete m_uiLayer; CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, "updateTreasureInfo"); CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, "refreshTreasureItems"); CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, "treasure_upgrade_success"); }
CompraBuscar::CompraBuscar(QWidget *parent) :QDialog(parent) ,ui(new Ui::CompraBuscar){ ui->setupUi(this); idCompra=INVALIDO; idPrestador=INVALIDO; idSocio=INVALIDO; ui->dateEditFinal->setDate(QDate::currentDate()); ui->dateEditInicio->setDate(QDate::currentDate().addDays(-28)); socioSeleccionado=false; prestadorSeleccionado=false; BD::buscarCompra(""); ui->tableView->setModel(model); QString styleSheet = "QHeaderView::section {" "spacing: 10px;" "background-color: lightblue;" "color: black;" "border: 1px solid black;" "margin: 1px;" "text-align: right;" "font-family: arialblack;" "height: 30px;" "font-size: 20px; }"; ui->tableView->horizontalHeader()->setStyleSheet(styleSheet); styleSheet = "QTableView::item:selected{ background-color: lightblue; color: black;} "; ui->tableView->setStyleSheet(styleSheet); ui->tableView->horizontalHeader()->setResizeMode(QHeaderView::Fixed); connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(editarCompra())); connect(ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(comboBox())); connect(ui->dateEditInicio,SIGNAL(dateChanged(QDate)), this, SLOT(comboBox())); connect(ui->dateEditFinal,SIGNAL(dateChanged(QDate)), this, SLOT(comboBox())); connect(ui->radioButton,SIGNAL(toggled(bool)), this, SLOT(comboBox())); ui->tableView->setVisible(false); ui->tableView->resizeColumnsToContents(); ui->tableView->setVisible(true); setTableView(); }
void CompraBuscar::comboBox(){ setTableView(); }
void CompraBuscar::repopularModelo() { setTableView(); }