Hi,
You can try a different solution.
Let's see it is easy and safe also.
class GetComboInstance
{
public:
static GetComboInstance* createInstance();
updateCombo();
private:
QComboBox *m_pComboBox;
static GetComboInstance *m_pInstance;
};
In Cpp file:
static GetComboInstance *GetComboInstance::m_pInstance = NULL;
static GetComboInstance* GetComboInstance::createInstance()
{
if(m_pInstance == NULL)
{
m_pInstance = new GetComboInstance();
}
return m_pInstance;
}
now you can call updateCombo method on your instance of GetComboInstance class from any class. It is better and safe way.
Bookmarks