Changeset dfabbb4 in mmcs for genericFunctions.cpp
- Timestamp:
- Sep 8, 2016, 12:11:37 PM (8 years ago)
- Branches:
- master
- Children:
- b23848e
- Parents:
- 0b59ba5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
genericFunctions.cpp
r0b59ba5 rdfabbb4 381 381 } 382 382 383 /** 384 @brief Funcion que sumar todos los elementos de un vector 385 @date 08/09/2016 386 @author Rodrigo Boet 387 @param <valor> Recibe un vector de tipo <double> 388 @return <suma> retorna la suma de los elementos 389 */ 390 double sumElements(QVector<double> valor) 391 { 392 int cantidad = valor.count(); 393 double suma = 0; 394 for(int i=0;i<cantidad;i++) 395 { 396 suma+= valor.at(i); 397 } 398 return suma; 399 } 400 401 /** 402 @brief Funcion que permite 403 @date 08/09/2016 404 @author Rodrigo Boet 405 @param <tw> Recibe el widget de la tabla 406 @param <inicio> Recibe el inicio 407 @param <fin> Recibe el fin 408 @param <item> Recibe el indice de la fila/columna 409 @param <fila> Recibe un booleano (True si es fila, de lo contrario es una columna) 410 */ 411 void RowColNoEditable(QTableWidget *tw,int inicio,int fin,int item, bool fila) 412 { 413 for(int i=inicio;i<=fin;i++) 414 { 415 if(fila) 416 { 417 QTableWidgetItem *ValoraInsertarFila = new QTableWidgetItem; 418 ValoraInsertarFila->setFlags(ValoraInsertarFila->flags() ^ Qt::ItemIsEditable); 419 tw->setItem(item,i,ValoraInsertarFila); 420 } 421 else 422 { 423 QTableWidgetItem *ValoraInsertarColumna = new QTableWidgetItem; 424 ValoraInsertarColumna->setFlags(ValoraInsertarColumna->flags() ^ Qt::ItemIsEditable); 425 tw->setItem(i,item,ValoraInsertarColumna); 426 } 427 428 } 429 } 430
Note: See TracChangeset
for help on using the changeset viewer.