No, it will work for QlistWidget, but for QTableWidget(X.Y) this is not enough. if I had QlistWidget also it would help me because
X= listWidget.count()/tableWidget.columnCount() and
Y = listWidget.count()%tableWidget.columnCount(); but I have only
QtableWidget.