C++ (Qt)template <class T>T & singleton(){ static T instance; return instance;}
C++ (Qt)MySingle * MySingle::mInstance = 0;static QMutex mutex; MySingle * MySingle::Instance( void ){ if (!mInstance) { QMutexlocker lock(&mutex); mInstance = new MySingle; } return mInstance;}
C++ (Qt)mInstance = new MySingle;