Skip to content
Advertisement

qtablewidget get new value after hitting “return”

i have a qtablewidget which is updated asynchronosly. now i am trying to set new values into the cells and read them back after hitting “enter/return”. i have a function that catches the keypressevent and try to read the actual value from the cell that was changed.
the problem: i only get the previous value of the cell, not the new entered value, because the function is called when the enter key is pressed which is right before the cell is updated whith the new value. i cannot use itemChanged().connect because the table is also changed from another proccess and i only want to catch my own changes.

old value (before editing value)
editing the value and hit enter

function that is called after hitting return:

JavaScript

Advertisement

Answer

i have a solution/ workaround for that problem: i had to change the current selected item. so the new value was applied and i could it read in the following.

after that:

JavaScript

the value was applied to the cell

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement