Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision abc967a6094f7e796599b302620784209216bfbd)
+++ src/Makefile.am	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
@@ -17,4 +17,11 @@
 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
+
+QTUIMOCS = QTMainWindow.moc.cpp
+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
@@ -24,5 +31,5 @@
 
 noinst_LIBRARIES = libmolecuilder.a
-bin_PROGRAMS = molecuilder joiner analyzer
+bin_PROGRAMS = molecuilder molecuildergui joiner analyzer 
 molecuilderdir = ${bindir}
 libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}
@@ -31,4 +38,9 @@
 molecuilder_SOURCES = builder.cpp
 molecuilder_LDADD = libmolecuilder.a
+#Stuff for building the GUI using QT
+molecuildergui_SOURCES = builder.cpp ${QTUISOURCE} ${QTUIMOCS} ${QTUIHEADER}
+molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} -DUSE_GUI_QT
+molecuildergui_LDFLAGS = ${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
 joiner_LDADD = libmolecuilder.a 
@@ -36,4 +48,17 @@
 analyzer_LDADD = libmolecuilder.a 
 
+
+#Rules needed for QT4
+# UI-Files are scattered throughout several subdirectories
+# Therfore `%'-rules do not seem to work
+#Quick fix to get it done otherwise
+${QTUIMOCS}:
+	list='$(QTUIHEADER)'; for header in $$list; do \
+	echo "Making mocfile for $$header"; \
+	target=`basename $$header | sed "s/\(.*\)\..*/\1.moc.cpp/"`;\
+	$(MOC) $(srcdir)/$$header -o $$target \
+	|| eval $$failcom; \
+	done;
+	
 #EXTRA_DIST = ${molecuilder_DATA}
 
Index: src/UIElements/QT4/QTMainWindow.cpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.cpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
+++ src/UIElements/QT4/QTMainWindow.cpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
@@ -0,0 +1,27 @@
+/*
+ * QTMainWindow.cpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#include "QTMainWindow.hpp"
+
+#include<iostream>
+
+using namespace std;
+
+QTMainWindow::QTMainWindow()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+QTMainWindow::~QTMainWindow()
+{
+  // TODO Auto-generated destructor stub
+}
+
+void QTMainWindow::display() {
+  cout << "Displaying the QTMainWindow" << endl;
+}
Index: src/UIElements/QT4/QTMainWindow.hpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.hpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
+++ src/UIElements/QT4/QTMainWindow.hpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
@@ -0,0 +1,27 @@
+/*
+ * QTMainWindow.hpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTMAINWINDOW_HPP_
+#define QTMAINWINDOW_HPP_
+
+#include "UIElements/MainWindow.hpp"
+#include <Qt/qmainwindow.h>
+
+class QTMainWindow : public QMainWindow, public MainWindow
+{
+  Q_OBJECT
+
+public:
+  QTMainWindow();
+  virtual ~QTMainWindow();
+
+  virtual void display();
+
+
+};
+
+#endif /* QTMAINWINDOW_HPP_ */
Index: src/UIElements/UIFactory.hpp
===================================================================
--- src/UIElements/UIFactory.hpp	(revision abc967a6094f7e796599b302620784209216bfbd)
+++ src/UIElements/UIFactory.hpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
@@ -22,5 +22,5 @@
 
 public:
-  enum InterfaceTypes {Text};
+  enum InterfaceTypes {Text,QT4};
   virtual ~UIFactory();
 
Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision abc967a6094f7e796599b302620784209216bfbd)
+++ src/builder.cpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
@@ -973,5 +973,9 @@
       populaters.MakeEditMoleculesMenu = populateEditMoleculesMenu;
 
+#ifdef USE_GUI_QT
+      UIFactory::makeUserInterface(UIFactory::QT4);
+#else
       UIFactory::makeUserInterface(UIFactory::Text);
+#endif
       MainWindow *mainWindow = UIFactory::get()->makeMainWindow(populaters,molecules, configuration, periode, ConfigFileName);
       mainWindow->display();
Index: src/menu.cpp
===================================================================
--- src/menu.cpp	(revision abc967a6094f7e796599b302620784209216bfbd)
+++ src/menu.cpp	(revision 3027f8c08886536cc3c48b3e9a171ffbea833152)
@@ -930,6 +930,6 @@
   molecule *srcmol = NULL, *destmol = NULL;
   Dialog *dialog = UIFactory::get()->makeDialog();
-  dialog->queryMolecule("Enter index of matrix molecule (the variable one): ",srcmol,molecules);
-  dialog->queryMolecule("Enter index of molecule to merge into (the fixed one): ",destmol,molecules);
+  dialog->queryMolecule("Enter index of matrix molecule (the variable one): ",&srcmol,molecules);
+  dialog->queryMolecule("Enter index of molecule to merge into (the fixed one): ",&destmol,molecules);
   if(dialog->display()) {
     molecules->EmbedMerge(destmol, srcmol);
