/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010-2012 University of Bonn. All rights reserved. * * * This file is part of MoleCuilder. * * MoleCuilder is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * MoleCuilder is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MoleCuilder. If not, see . */ /* * QtUIFactory.cpp * * Created on: Jan 14, 2010 * Author: crueger */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "UIElements/Qt4/QtUIFactory.hpp" #include "UIElements/Qt4/QtMainWindow.hpp" #include "UIElements/Qt4/QtDialog.hpp" #include "CodePatterns/MemDebug.hpp" #include "version.h" #include "Helpers/defs.hpp" using namespace std; QtUIFactory::QtUIFactory() : argc(1) { // For now we just fake the command line parameters to make QT happy argv = new char*[1]; argv[0] = new char[256]; strcpy(argv[0],MOLECUILDERVERSION); app = new QApplication(argc,argv); } QtUIFactory::~QtUIFactory() { //delete app; delete [] argv[0]; delete [] argv; } Dialog* QtUIFactory::makeDialog() { return new QtDialog(); } MainWindow* QtUIFactory::makeMainWindow() { return new QtMainWindow(app); } QtUIFactory::description::description() : UIFactory::factoryDescription("Qt4") {} QtUIFactory::description::~description() {} UIFactory* QtUIFactory::description::makeFactory(){ return new QtUIFactory(); }