Minor change according to the evolution of Qt class (remove QGraphicsScene from constructor of QGraphicsItem).

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3547 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-12-14 13:06:21 +00:00
parent 62fa93ea1b
commit 5e935a976e
34 changed files with 158 additions and 148 deletions

View File

@@ -33,41 +33,43 @@ class Diagram;
*/
class ElementFactory
{
//methods for singleton pattern
//methods for singleton pattern
public:
// return instance of factory
static ElementFactory* Instance() {
static QMutex mutex;
if (!factory_) {
mutex.lock();
if (!factory_) factory_ = new ElementFactory();
mutex.unlock();
// return instance of factory
static ElementFactory* Instance() {
static QMutex mutex;
if (!factory_) {
mutex.lock();
if (!factory_) factory_ = new ElementFactory();
mutex.unlock();
}
return factory_;
}
return factory_;
}
// delete the instance of factory
static void dropInstance () {
static QMutex mutex;
if (factory_) {
mutex.lock();
delete factory_;
factory_ = 0;
mutex.unlock();
}
}
//attributes
private:
static ElementFactory* factory_;
//methods for the class factory himself
// delete the instance of factory
static void dropInstance () {
static QMutex mutex;
if (factory_) {
mutex.lock();
delete factory_;
factory_ = 0;
mutex.unlock();
}
}
//attributes
private:
ElementFactory() {}
ElementFactory (const ElementFactory &);
ElementFactory operator= (const ElementFactory &);
~ElementFactory() {}
static ElementFactory* factory_;
//methods for the class factory himself
private:
ElementFactory() {}
ElementFactory (const ElementFactory &);
ElementFactory operator= (const ElementFactory &);
~ElementFactory() {}
public:
Element * createElement (const ElementsLocation &, QGraphicsItem * = 0, Diagram * = 0, int * = 0);
Element * createElement (const ElementsLocation &, QGraphicsItem * = 0, int * = 0);
};
//ElementFactory ElementFactory::factory_ = 0;
#endif // ELEMENTFACTORY_H