Hi to all!

I am facing a problem of retrieving all items from a given column of a QTableWidget to a QComboBox. The problem itself appears when I diplay the retrieved items in the ComboBox, because their number get increased. For instance, if I have three rows and four columns, three items are displayed repeately up to twelve in total. I just wanted to have three items corresponding to the number of the rows.

Some precisions:

1- Name is the name of the column fron wich the items should be selected.
2- m_details is my combobox.
3- m_tableau is my TableWidget.

Even the function:
Qt Code:
  1. m_details->setDuplicatesEnabled(false);
To copy to clipboard, switch view to plain text mode 
does not solve the problem.

Could someone have a look on my peace of code and propose me an advice? I would be greatefull.

Here is my code:

Qt Code:
  1. for(int y = 0; y<m_tableau->rowCount(); y++)
  2. {
  3. for(int x = 0; x<m_tableau->columnCount(); x++)
  4. {
  5. valCol = m_tableau->horizontalHeaderItem(x);
  6. valColConver = valCol->text();
  7.  
  8. if(valColConver == "Name")
  9. {
  10. valCell = m_tableau->item(y, x);
  11.  
  12. if(valCell != NULL)
  13. {
  14. valConver = valCell->text();
  15.  
  16. listeItem.push_back(valConver);
  17.  
  18. m_details->addItems(listeItem);
  19.  
  20. valConver.clear();
  21. valColConver.clear();
  22. }
  23. }
  24.  
  25. }
To copy to clipboard, switch view to plain text mode 

Many thanks in advance.