Changeset f473a7f in mmcs for mainwindow.C


Ignore:
Timestamp:
Jul 18, 2016, 2:49:49 PM (8 years ago)
Author:
rudmanmrrod <rudman22@…>
Branches:
master
Children:
4d3d740
Parents:
50b61b5
Message:

Modificada funcionalidad al definir las cuentas exogenas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mainwindow.C

    r50b61b5 rf473a7f  
    17551755    {
    17561756        int elementos = contarElementosMap(diccCuentasExogenas);
    1757 
    17581757        /*****      Se llena la tabla vacia con los valores de la tabla principal ****/
    17591758        for(int i=0;i<count-1;i++)
     
    17991798
    18001799        /***                    Se acomodan los componentes de las cuentas exogenas                 ***/
    1801         int cantidad =tablaEE->rowCount();
     1800        int cantidad = tablaEE->rowCount()-elementos;
    18021801        foreach(QString key,diccCuentasExogenas.keys())
    18031802        {
    18041803            foreach(QString key2,diccCuentasExogenas[key])
    18051804            {
    1806                 for(int i=2;i<cantidad;i++)
     1805                for(int i=2;i<=cantidad;i++)
    18071806                {
    1808                     QString cuenta=tablaEE->item(1,i)->text();
    1809                     QString componente =tablaEE->item(2,i)->text();
     1807                    QString cuenta=tablaEE->item(0,i)->text();
     1808                    QString componente =tablaEE->item(1,i)->text();
    18101809                    if(key==cuenta and key2==componente)
    18111810                    {
     1811                        int position = cantidad+elementos-1;
    18121812                        QList<QString> fila;
    18131813                        fila=llenarLista(fila,tablaEE,i,1);
    1814                         tablaEE->removeRow(i-1);
     1814                        tablaEE->removeRow(i);
    18151815                        tablaEE->insertRow(tablaEE->rowCount());
    18161816                        insertRowExogena(fila,tablaEE,1);
    18171817                        fila.clear();
     1818                        //Se agregan los estilos correspondientes a las cuentas y componentes de las filas
     1819                        QString nombre_cuenta = tablaEE->item(position,0)->text();
     1820                        QTableWidgetItem *ValoraInsertarCuentaF = new QTableWidgetItem(nombre_cuenta);
     1821                        CellStyle(ValoraInsertarCuentaF);
     1822                        tablaEE->setItem(position,0,ValoraInsertarCuentaF);
     1823                        QString nombre_componente = tablaEE->item(position,1)->text();
     1824                        QTableWidgetItem *ValoraInsertarComponenteF = new QTableWidgetItem(nombre_componente);
     1825                        CellStyleComponente(ValoraInsertarComponenteF);
     1826                        tablaEE->setItem(position,1,ValoraInsertarComponenteF);
     1827
    18181828
    18191829                        QList<QString> columna;
    18201830                        columna=llenarLista(columna,tablaEE,i,0);
    1821                         tablaEE->removeColumn(i-1);
     1831                        tablaEE->removeColumn(i);
    18221832                        tablaEE->insertColumn(tablaEE->columnCount());
    18231833                        insertRowExogena(columna,tablaEE,0);
    18241834                        columna.clear();
     1835                        //Se agregan los estilos correspondientes a las cuentas y componentes de las columnas
     1836                        QTableWidgetItem *ValoraInsertarCuentaC = new QTableWidgetItem(nombre_cuenta);
     1837                        CellStyle(ValoraInsertarCuentaC);
     1838                        tablaEE->setItem(0,position,ValoraInsertarCuentaC);
     1839                        QTableWidgetItem *ValoraInsertarComponenteC = new QTableWidgetItem(nombre_componente);
     1840                        CellStyleComponente(ValoraInsertarComponenteC);
     1841                        tablaEE->setItem(1,position,ValoraInsertarComponenteC);
    18251842                    }
    18261843                }
Note: See TracChangeset for help on using the changeset viewer.