source: mmcs/formloadmatrix.C @ 68e57de

Last change on this file since 68e57de was 68e57de, checked in by rboet <rudmanmrrod@…>, 9 years ago

solucionado una dependencia de recurso para la imagen de cargar matriz

  • Property mode set to 100755
File size: 1.3 KB
Line 
1/*
2    realizado por José Ruiz en Mayo de 2015
3*/
4#include "formloadmatrix.H"
5#include "ui_formLoadMatrix.h"
6
7void FormLoadMatrix::closeEvent(QCloseEvent *)
8{
9    emit formClosed();
10}
11
12FormLoadMatrix::FormLoadMatrix(QWidget * parent)
13    : QWidget(parent, Qt::Tool)
14{
15    ui.setupUi(this);
16
17    int x = parent->pos().x() + parent->width()/2 - this->width()/2;
18    int y = parent->pos().y() + parent->height()/2 - this->height()/2;
19    this->move(x, y);
20
21    connect(ui.buttonSearch, SIGNAL(clicked()),this,SLOT(slotLoadMatrixFile()));
22    connect(ui.buttonCancel, SIGNAL(clicked()),this,SLOT(close()));
23    connect(ui.buttonOpen, SIGNAL(clicked()), this,
24            SLOT(slotButtonAcceptClicked()));
25
26}
27
28void FormLoadMatrix::slotLoadMatrixFile() {
29    QString filename = QFileDialog::getOpenFileName(this,
30            "Seleccione archivo de Matriz", QDir::homePath(),"*.csv");
31
32    if(filename.isEmpty()) return;
33    ui.editFilePath->setText(filename);
34}
35
36void FormLoadMatrix::slotButtonAcceptClicked()
37{
38    if (ui.editFilePath->text().isEmpty())
39    {
40        QMessageBox::critical(this, "Faltan datos",
41                              "Debe seleccionar un archivo");
42
43        ui.editFilePath->setFocus();
44        return;
45    }
46
47    emit formAccepted(ui.editFilePath->text(), ui.spinNumber->value(),ui.spinBox->value());
48
49    close();
50}
Note: See TracBrowser for help on using the repository browser.