qt - QSqlTableModel dataChanged -


i'm using following command update column on particular table view:

connect(sale,signal(datachanged(qmodelindex,qmodelindex,qvector<int>)),this,slot(calculatesale(qmodelindex))); 

the function calculatesale(qmodelindex), calculates several things on particular column pointed qmodelindex. works perfect, no problems here.

there times want call calculatesale(qmodelindex) directly in for() loop recalculate columns in table. i'm puzzled how create dummy qmodelindex can loop column number.

what want call, function:

void calculatesale(qmodelindex colposition); 

from somewhere else in program. this psudo code of want do:

qmodelindex a; a.column=3; calculatesale(a): 

here answering own question. solution simple , has nothing creating "fake" qmodelindex call function.

connect(sale,signal(datachanged(qmodelindex,qmodelindex,qvector<int>)),this,slot(calculatesale(qmodelindex))) 

this function doing bunch of calculations specific column contained in qmodelindex. problem wanted iterate function update columns @ once on occasions. solution move code function can call anywhere in code lets void updatecolumn(int x). had function on slot grab column qmodelindex , call new function.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -