Formula from CSV to tableView
-
Thanks to this video I found a way on how to copy my CSV file in a tableView.
But I was wondering, is there a way to also have the formula (like =SUM(n1; n2)) from CSV to tableView? Because at the moment I only visualize the result number in the cell and not the formula underneath -
Thanks to this video I found a way on how to copy my CSV file in a tableView.
But I was wondering, is there a way to also have the formula (like =SUM(n1; n2)) from CSV to tableView? Because at the moment I only visualize the result number in the cell and not the formula underneath@aim0d
Your topic title readsFormula from CVS to tableView
Note that CVS is a US pharmacy chain, not a Excel-type file format. It probably sells baby formula :)
Sure you can choose to put
=SUM(n1; n2)
as the content of a cell if you want. You can even store both that and the result,42
or whatever, under separate roles in the table view's model. I can't find it now, but somewhere in docs there is a mention that in a spreadsheet model you might store a cell's formula under itsEditRole
and the formula's calculated value under itsDisplayRole
, or even dynamically compute that and return it fromdata(DisplayRole)
override.But nothing is going to actually do that formula calculation for you --- you have to write that code!
-
@aim0d
Your topic title readsFormula from CVS to tableView
Note that CVS is a US pharmacy chain, not a Excel-type file format. It probably sells baby formula :)
Sure you can choose to put
=SUM(n1; n2)
as the content of a cell if you want. You can even store both that and the result,42
or whatever, under separate roles in the table view's model. I can't find it now, but somewhere in docs there is a mention that in a spreadsheet model you might store a cell's formula under itsEditRole
and the formula's calculated value under itsDisplayRole
, or even dynamically compute that and return it fromdata(DisplayRole)
override.But nothing is going to actually do that formula calculation for you --- you have to write that code!