Hi Community,
I'm having trouble with a QTableWidget that's part of a dialog.
The table has 6 columns; The cells belonging to the first columns contains only text while the others contains a QComboBox widget (each combobox has 3 text items).
In my code I need to detect which combobox widget was changed so I connected the cellChanged signal to my slot in this way:

Qt Code:
  1. connect( tableBiasRadar_, SIGNAL(cellChanged(int, int)), this, SLOT(tableBiasRadar__cellChanged(int, int)));
To copy to clipboard, switch view to plain text mode 

And the relative slot:

Qt Code:
  1. void OtrParametersDialogCtrl::tableBiasRadar__cellChanged(int row, int col)
  2. {
  3. std::cerr << "[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChanged : Row: " << row << " Col: " << col << std::endl;
  4.  
  5. // If the column changed is the time offset, change all other modes of the radar
  6. if (static_cast<RadarBiasTableColums_>(col) != radarBiasTableTimeOffsetC_)
  7. {
  8. return;
  9. }
  10.  
  11. // Get the value set by the user
  12. QComboBox *item = qobject_cast<QComboBox*>(tableBiasRadar_->cellWidget(row, col));
  13. if (item == nullptr)
  14. {
  15. return;
  16. }
  17.  
  18. // Look for the radar that is being edited by this item
  19. const int radarId = tableBiasRadar_Column2RadarId_[row];
  20.  
  21. // Change the value of the combo box in all other rows that edit this item
  22. for (size_t i = 0; i < tableBiasRadar_Column2RadarId_.size(); ++i)
  23. {
  24. if (i != static_cast<size_t>(row) && tableBiasRadar_Column2RadarId_[i] == radarId)
  25. {
  26. QComboBox *itemToBeModified = qobject_cast<QComboBox*>(tableBiasRadar_->cellWidget(static_cast<int>(i), col));
  27. if (itemToBeModified != nullptr)
  28. {
  29. itemToBeModified->setCurrentIndex(item->currentIndex());
  30. }
  31. }
  32. }
  33. }
To copy to clipboard, switch view to plain text mode 

It doesn't matter which combobox I change, I always get the same output:

[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 0 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 1 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 2 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 3 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 4 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 5 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 6 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 7 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 8 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 9 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 10 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 11 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 12 Col: 0
[DEBUG] OtrParametersDialogCtrl::tableBiasRadar__valueChan ged : Row: 13 Col: 0
I would like to have a help in discovering why I always get the column 0 (the column 0 does not contain any combobox, only text) even when I change the combobox of other columns and why I get the output of all the rows also if I change only 1 row.

The look&feel of the dialog looks correct, all the cells belonging to column 1 to 6 contains the combobox, so I really don't understand what's happening here. I am using 5.9.7, unfortunately this is a constraint.
Could it be a bug in this Qt version?

I hope to get help.
Franco