Quote Originally Posted by spirit View Post
you must init static variable
Qt Code:
  1. QComboBox *Test::m_comboBox = new QComboBox();
To copy to clipboard, switch view to plain text mode 

why do you need this method of storing/getting of QComboBox?
i already got my solution... i have posted it...

I need to get the combo box pointer as i need to add items to it from a different class.

If i use a normal member function to return the combo box pointer it won't work as as i have to first create an instance of this class in the other class to invoke the member function. As soon as i create an instance, the member combo box variable is allocated a new memory and i am not able to get the original combo box pointer.

So , i have to call it directly without using an object, so i have to use either statiic or a global variable...

pls read my earlier post and suggest if i should go for global or static member variable.