Here we go for the second approach (subclass QComboBox). I recommend the first approach (QSignalMapper), though.

Disclaimer: I did not even try to compile this code, there may be errors.

Qt Code:
  1. class MyComboBox : public QComboBox {
  2. Q_OBJECT
  3. public:
  4. MyComboBox(int id, QWidget *parent = 0);
  5. signals:
  6. void currentIndexChanged(int index, int id);
  7. protected slots:
  8. void onCurrentIndexChanged(int index);
  9. protected:
  10. int m_id;
  11. };
  12.  
  13. MyComboBox::MyComboBox(int id, QWidget *parent) : QComboBox(parent), m_id(id) {
  14. connect(this, SIGNAL(currentIndexChanged(int)), SLOT(onCurrentIndexChanged(int)));
  15. }
  16.  
  17. void MyComboBox::onCurrentIndexChanged(int index) {
  18. emit currentIndexChanged(index, m_id);
  19. }
To copy to clipboard, switch view to plain text mode 
Signals are not simple methods (although they are implemented by moc as methods). They are emitted by a component and you need to connect them to a slot to react to their emission.