Hi all,

I would like to have access to the index of the item selected from the QComboBox.

I have written the following line:

mComboBoxSigSelect = new QComboBox(this);
connect(mComboBoxSigSelect, SIGNAL(currentIndexChanged(int)), this, SIGNAL(CurrentIndex()));

The above lines are in a file code1.cpp and I need to have access to the index of the item chosen by the user in another file Code2.cpp.

I have mentioned the following lines code1.h (header file for code1.cpp):

class My_Signals : public QWidget
{
Q_OBJECT

public:

signals:
int CurrentIndex();

public slots:

private:

};

In Code2.cpp, i have the following lines:
My_constructor::My_constructor
{
.
.
.
int k=CurrentIndex(); // Want to save the index value from Code1.cpp into the variable 'k'
}

int SignalTimeDomainPlot::CurrentIndex()
{
// code ??
}



And in Code2.h (header file for Code2.cpp), I have written:

class My_Code : public QWidget
{
Q_OBJECT

public:

signals:

public slots:

int CurrentIndex();

private:

};


Please help! Thanks