'Pyqt5: add-in widgets off cells with new row added

My app works like this: when I hit the blue button in the bottom of the table, a new row will be added, like this:

click the blue button to add a row

However, the dateEdit widgets are a little bit off cells:

off-cell dateEdit widgets

However, as long as I resize the window a little bit they are well placed in the cells again:

well-placed dateEdit widgets

I would like to know why this happens and is there any workarounds?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source