| [bcf653] | 1 | /* | 
|---|
|  | 2 | * Project: MoleCuilder | 
|---|
|  | 3 | * Description: creates and alters molecular systems | 
|---|
| [0aa122] | 4 | * Copyright (C)  2010-2012 University of Bonn. All rights reserved. | 
|---|
| [94d5ac6] | 5 | * | 
|---|
|  | 6 | * | 
|---|
|  | 7 | *   This file is part of MoleCuilder. | 
|---|
|  | 8 | * | 
|---|
|  | 9 | *    MoleCuilder is free software: you can redistribute it and/or modify | 
|---|
|  | 10 | *    it under the terms of the GNU General Public License as published by | 
|---|
|  | 11 | *    the Free Software Foundation, either version 2 of the License, or | 
|---|
|  | 12 | *    (at your option) any later version. | 
|---|
|  | 13 | * | 
|---|
|  | 14 | *    MoleCuilder is distributed in the hope that it will be useful, | 
|---|
|  | 15 | *    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
|  | 16 | *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
|  | 17 | *    GNU General Public License for more details. | 
|---|
|  | 18 | * | 
|---|
|  | 19 | *    You should have received a copy of the GNU General Public License | 
|---|
|  | 20 | *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>. | 
|---|
| [bcf653] | 21 | */ | 
|---|
|  | 22 |  | 
|---|
| [ea94a8] | 23 | /* | 
|---|
| [4cf323d] | 24 | * QtUIFactory.cpp | 
|---|
| [ea94a8] | 25 | * | 
|---|
|  | 26 | *  Created on: Jan 14, 2010 | 
|---|
|  | 27 | *      Author: crueger | 
|---|
|  | 28 | */ | 
|---|
|  | 29 |  | 
|---|
| [bbbad5] | 30 | // include config.h | 
|---|
|  | 31 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 32 | #include <config.h> | 
|---|
|  | 33 | #endif | 
|---|
|  | 34 |  | 
|---|
| [ea94a8] | 35 | #include <iostream> | 
|---|
|  | 36 | #include <cassert> | 
|---|
|  | 37 |  | 
|---|
| [4269ca] | 38 | #include <Qt/qapplication.h> | 
|---|
| [8f67e2] | 39 |  | 
|---|
| [bbbad5] | 40 |  | 
|---|
| [4cf323d] | 41 | #include "UIElements/Qt4/QtUIFactory.hpp" | 
|---|
|  | 42 | #include "UIElements/Qt4/QtMainWindow.hpp" | 
|---|
|  | 43 | #include "UIElements/Qt4/QtDialog.hpp" | 
|---|
| [bbbad5] | 44 |  | 
|---|
| [ad011c] | 45 | #include "CodePatterns/MemDebug.hpp" | 
|---|
| [bbbad5] | 46 |  | 
|---|
| [6a661c] | 47 | #include "version.h" | 
|---|
| [e4fe8d] | 48 | #include "Helpers/defs.hpp" | 
|---|
| [bbbad5] | 49 |  | 
|---|
|  | 50 | using namespace std; | 
|---|
| [ea94a8] | 51 |  | 
|---|
| [4cf323d] | 52 | QtUIFactory::QtUIFactory() : | 
|---|
| [97b825] | 53 | argc(1) | 
|---|
| [ea94a8] | 54 | { | 
|---|
| [6a661c] | 55 | // For now we just fake the command line parameters to make QT happy | 
|---|
|  | 56 | argv = new char*[1]; | 
|---|
|  | 57 | argv[0] = new char[256]; | 
|---|
| [5f8660a] | 58 | strcpy(argv[0],MOLECUILDERVERSION); | 
|---|
| [6a661c] | 59 | app = new QApplication(argc,argv); | 
|---|
| [ea94a8] | 60 | } | 
|---|
|  | 61 |  | 
|---|
| [4cf323d] | 62 | QtUIFactory::~QtUIFactory() | 
|---|
| [ea94a8] | 63 | { | 
|---|
| [da8f97] | 64 | //delete app; | 
|---|
| [6a661c] | 65 | delete [] argv[0]; | 
|---|
|  | 66 | delete [] argv; | 
|---|
| [ea94a8] | 67 | } | 
|---|
|  | 68 |  | 
|---|
| [4cf323d] | 69 | Dialog* QtUIFactory::makeDialog() { | 
|---|
|  | 70 | return new QtDialog(); | 
|---|
| [ea94a8] | 71 | } | 
|---|
|  | 72 |  | 
|---|
| [4cf323d] | 73 | MainWindow* QtUIFactory::makeMainWindow() { | 
|---|
|  | 74 | return new QtMainWindow(app); | 
|---|
| [ea94a8] | 75 | } | 
|---|
| [82b71a] | 76 |  | 
|---|
| [4cf323d] | 77 | QtUIFactory::description::description() : | 
|---|
|  | 78 | UIFactory::factoryDescription("Qt4") | 
|---|
| [82b71a] | 79 | {} | 
|---|
|  | 80 |  | 
|---|
| [4cf323d] | 81 | QtUIFactory::description::~description() | 
|---|
| [82b71a] | 82 | {} | 
|---|
|  | 83 |  | 
|---|
| [4cf323d] | 84 | UIFactory* QtUIFactory::description::makeFactory(){ | 
|---|
|  | 85 | return new QtUIFactory(); | 
|---|
| [82b71a] | 86 | } | 
|---|