Cant change cell data one below cell
-
@hubeytqew
So are you saying yoursetData()s now work OK?What is the difference between object of QTableWidget/QTableView and only ui->tableWidget ?
QTableViewprovides the base functionality for binding to a data model and showing/editing its content in rows and columns of cells.QTableWidgetis derived fromQTableView, so it starts out with all that class's functionality. Principally it then adds it its own data model, so you don't have to create one, and it also adds an "item based approach" to adding data.QTableWidgetis easiest for beginners as it is self-contained, you don't have to understand about models to use it. But as soon as you have/want your own model, or want to use a SQL database for the model, you wantQTableView.Your
ui->tableWidgetis presumably aQTableWidgetyou have created in Designer.@JonB said in Cant change cell data one below cell:
@hubeytqew
So are you saying yoursetData()s now work OK?No, its not :D As I said before; I leaved this solution, I tried another approach to do table of decrypted values. I fetch values from database, decrypt it, create new table with these decrypted values. So, the table is now same with the database but values are decrypted.
In this approach, I tried to created QTableWidget/View objects to use but I couldnt with these objects. Then I found/remembered, the solution was using ui->tableWidget->.. to show the table.
Thank you for your patience and good answers..Appreciate it!
-
@JonB said in Cant change cell data one below cell:
@hubeytqew
So are you saying yoursetData()s now work OK?No, its not :D As I said before; I leaved this solution, I tried another approach to do table of decrypted values. I fetch values from database, decrypt it, create new table with these decrypted values. So, the table is now same with the database but values are decrypted.
In this approach, I tried to created QTableWidget/View objects to use but I couldnt with these objects. Then I found/remembered, the solution was using ui->tableWidget->.. to show the table.
Thank you for your patience and good answers..Appreciate it!
@hubeytqew
I have to leave you to it. We have shown your table view/model have no problem callingsetData()for simple values like text. The only difference seems to be whatever yourinstance1.decrypt_it()does with theencryptedstring you hand it and what it returns intodecrypted. I don't have your data.