Is there a way to automatically clear non-initialized rows in a table? If all values in row except primary key are not initialized, using protocol or QAction.
Hi Andrey,
As far as I am aware that is not possible, you would need to read all the rows in a QAction and evaluate each column to determine whether or not they need to be deleted.
Not sure exactly the use case you have but if it were a scenario where you have a table that just gathers some temporary data that is not saved anywhere and after a restart you want to clear it, you could try the volatile option.
Otherwise, the only real option is to read it in a QAction.
I’d like to add that in most scenarios, the received data contains all the keys and should update the table without keeping pre-existing keys. If the keys can only be determined over multiple data ingestions, then keeping track of the known keys and cutting off at some point to remove all other keys shouldn’t be difficult nor involve a lot of notifications. If the situation is even more complex, a state column may be more appropriate, so only one column needs to be retrieved and evaluated.
Of course, this is assuming the table is populated by a QAction.
If the table is populated by SNMP polling, the deleteRow attribute can keep non-existing keys, but should only be used in some specific cases such as an SNMP table also functioning as a DVE table, which I believe is discouraged nowadays. In this case, you may want to review how you’re setting up and controlling your tables.