Here the header file:
#ifndef MAINDIALOG_H
#define MAINDIALOG_H
#include <QDialog>
#include <QHash>
{
Q_OBJECT
public:
private:
hash.insert(1, comboBox_1);
hash.insert(2, comboBox_2);
hash.insert(3, comboBox_3);
};
#endif
#ifndef MAINDIALOG_H
#define MAINDIALOG_H
#include <QDialog>
#include <QHash>
class QComboBox;
class MainDialog: public QDialog
{
Q_OBJECT
public:
MainDialog(QWidget *parent=0);
private:
QComboBox *comboBox_1;
QComboBox *comboBox_2;
QComboBox *comboBox_3;
QHash<int, QComboBox*> hash;
hash.insert(1, comboBox_1);
hash.insert(2, comboBox_2);
hash.insert(3, comboBox_3);
};
#endif
To copy to clipboard, switch view to plain text mode
Bookmarks