Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
+++ src/Makefile.am	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
@@ -17,13 +17,16 @@
 UIHEADER = ${ACTIONSHEADER} ${VIEWHEADER} ${MENUHEADER} UIElements/UIFactory.hpp UIElements/TextUIFactory.hpp UIElements/MainWindow.hpp UIElements/TextWindow.hpp UIElements/Dialog.hpp UIElements/TextDialog.hpp
 
-QTUISOURCE = UIElements/QT4/QTMainWindow.cpp
-QTUIHEADER = UIElements/QT4/QTMainWindow.hpp
+QTUIMOC_HEADER = UIElements/QT4/QTMainWindow.hpp 
+QTUIMOC_TARGETS = QTMainWindow.moc.cpp
 
-QTUIMOCS = QTMainWindow.moc.cpp
+QTUISOURCE = ${QTUIMOC_TARGETS} UIElements/QT4/QTMainWindow.cpp UIElements/QT4/QTUIFactory.cpp
+QTUIHEADER = ${QTUIMOC_HEADER} UIElements/QT4/QTUIFactory.hpp
+
 QTUI_DEFS = 
 
-
-SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${UISOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp leastsquaremin.cpp linkedcell.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp menu.cpp
-HEADER = ${ANALYSISHEADER} ${ATOMHEADER} ${UIHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp menu.hpp
+#Right now QT is included in all Builds for simplicity of the build process
+# TODO: Find a way to extract Files using QT and seperate the build process into two parts
+SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${UISOURCE} ${QTUISOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp leastsquaremin.cpp linkedcell.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp menu.cpp
+HEADER = ${ANALYSISHEADER} ${ATOMHEADER} ${UIHEADER} ${QTUIHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp menu.hpp
 
 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
@@ -33,13 +36,15 @@
 bin_PROGRAMS = molecuilder molecuildergui joiner analyzer 
 molecuilderdir = ${bindir}
+libmolecuilder_a_CXXFLAGS = ${QT_CXXFLAGS}
 libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}
 molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db
-molecuilder_LDFLAGS = $(BOOST_LIB)
-molecuilder_SOURCES = builder.cpp
-molecuilder_LDADD = libmolecuilder.a
+molecuilder_CXXFLAGS = ${QT_CXXFLAGS}
+molecuilder_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS}
+molecuilder_SOURCES = builder.cpp 
+molecuilder_LDADD = libmolecuilder.a ${QT_LDADD} ${QT_LIB_GUI}
 #Stuff for building the GUI using QT
-molecuildergui_SOURCES = builder.cpp ${QTUISOURCE} ${QTUIMOCS} ${QTUIHEADER}
+molecuildergui_SOURCES = builder.cpp
 molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} -DUSE_GUI_QT
-molecuildergui_LDFLAGS = ${QT_LDFLAGS}
+molecuildergui_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS}
 molecuildergui_LDADD = libmolecuilder.a ${QT_LDADD} ${QT_LIB_GUI}
 joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp
@@ -53,5 +58,5 @@
 # Therfore `%'-rules do not seem to work
 #Quick fix to get it done otherwise
-${QTUIMOCS}:
+${QTUIMOC_TARGETS}:
 	list='$(QTUIHEADER)'; for header in $$list; do \
 	echo "Making mocfile for $$header"; \
Index: src/UIElements/QT4/QTMainWindow.cpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.cpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
+++ src/UIElements/QT4/QTMainWindow.cpp	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
@@ -12,5 +12,5 @@
 using namespace std;
 
-QTMainWindow::QTMainWindow()
+QTMainWindow::QTMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName)
 {
   // TODO Auto-generated constructor stub
Index: src/UIElements/QT4/QTMainWindow.hpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.hpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
+++ src/UIElements/QT4/QTMainWindow.hpp	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
@@ -17,5 +17,5 @@
 
 public:
-  QTMainWindow();
+  QTMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName);
   virtual ~QTMainWindow();
 
Index: src/UIElements/QT4/QTUIFactory.cpp
===================================================================
--- src/UIElements/QT4/QTUIFactory.cpp	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
+++ src/UIElements/QT4/QTUIFactory.cpp	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
@@ -0,0 +1,35 @@
+/*
+ * QTUIFactory.cpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#include <iostream>
+#include <cassert>
+
+using namespace std;
+
+#include "UIElements/QT4/QTUIFactory.hpp"
+#include "UIElements/QT4/QTMainWindow.hpp"
+
+QTUIFactory::QTUIFactory()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+QTUIFactory::~QTUIFactory()
+{
+  // TODO Auto-generated destructor stub
+}
+
+Dialog* QTUIFactory::makeDialog() {
+  assert(0 && "Not implemented yet");
+  return 0;
+}
+
+MainWindow* QTUIFactory::makeMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName) {
+  cout << "making QT4 Window" << endl;
+  return new QTMainWindow(populaters,molecules,configuration,periode,ConfigFileName);
+}
Index: src/UIElements/QT4/QTUIFactory.hpp
===================================================================
--- src/UIElements/QT4/QTUIFactory.hpp	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
+++ src/UIElements/QT4/QTUIFactory.hpp	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
@@ -0,0 +1,27 @@
+/*
+ * QTUIFactory.hpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTUIFACTORY_HPP_
+#define QTUIFACTORY_HPP_
+
+#include "UIElements/UIFactory.hpp"
+
+class QTUIFactory : public UIFactory
+{
+  friend class UIFactory;
+
+public:
+  virtual ~QTUIFactory();
+
+  virtual Dialog* makeDialog();
+  virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *);
+
+protected:
+  QTUIFactory();
+};
+
+#endif /* QTUIFACTORY_HPP_ */
Index: src/UIElements/TextUIFactory.hpp
===================================================================
--- src/UIElements/TextUIFactory.hpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
+++ src/UIElements/TextUIFactory.hpp	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
@@ -13,5 +13,5 @@
 class TextUIFactory : public UIFactory
 {
-friend class UIFactory;
+  friend class UIFactory;
 
 public:
Index: src/UIElements/UIFactory.cpp
===================================================================
--- src/UIElements/UIFactory.cpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
+++ src/UIElements/UIFactory.cpp	(revision ea94a8adcea12b6f8cf88a9d54bb7644629c360e)
@@ -12,4 +12,5 @@
 // all factories that can be used:
 #include "UIElements/TextUIFactory.hpp"
+#include "UIElements/QT4/QTUIFactory.hpp"
 
 UIFactory *UIFactory::theFactory = 0;
@@ -32,4 +33,7 @@
       theFactory = new TextUIFactory();
       break;
+    case QT4 :
+      theFactory = new QTUIFactory();
+      break;
 
     default:
