Here the header file:

Qt Code:
  1. #ifndef MAINDIALOG_H
  2. #define MAINDIALOG_H
  3.  
  4. #include <QDialog>
  5. #include <QHash>
  6.  
  7. class QComboBox;
  8.  
  9. class MainDialog: public QDialog
  10. {
  11. Q_OBJECT
  12. public:
  13. MainDialog(QWidget *parent=0);
  14.  
  15. private:
  16. QComboBox *comboBox_1;
  17. QComboBox *comboBox_2;
  18. QComboBox *comboBox_3;
  19.  
  20. QHash<int, QComboBox*> hash;
  21. hash.insert(1, comboBox_1);
  22. hash.insert(2, comboBox_2);
  23. hash.insert(3, comboBox_3);
  24. };
  25.  
  26. #endif
To copy to clipboard, switch view to plain text mode