Index: src/UIElements/Dialog.cpp
===================================================================
--- src/UIElements/Dialog.cpp	(revision 2ededc23ca840f65c2141748eec08536adbb27d6)
+++ src/UIElements/Dialog.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -31,4 +31,14 @@
 
 bool Dialog::display(){
+  if(checkAll()){
+    setAll();
+    return true;
+  }
+  else{
+    return false;
+  }
+}
+
+bool Dialog::checkAll(){
   list<Query*>::iterator iter;
   bool retval = true;
@@ -39,11 +49,12 @@
       break;
   }
-  if (retval){
-    // if all queries succeeded we can set the targets to appropriate values
-    for(iter=queries.begin(); iter!=queries.end(); iter++) {
-      (*iter)->setResult();
-    }
+  return retval;
+}
+
+void Dialog::setAll(){
+  list<Query*>::iterator iter;
+  for(iter=queries.begin(); iter!=queries.end(); iter++) {
+    (*iter)->setResult();
   }
-  return retval;
 }
 
@@ -76,5 +87,7 @@
 
 Dialog::StringQuery::StringQuery(string title,string *_target) :
-    Query(title), target(_target)
+    Query(title),
+    target(_target),
+    tmp("")
 {}
 
Index: src/UIElements/Dialog.hpp
===================================================================
--- src/UIElements/Dialog.hpp	(revision 2ededc23ca840f65c2141748eec08536adbb27d6)
+++ src/UIElements/Dialog.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -29,4 +29,7 @@
 
   virtual bool display();
+
+  virtual bool checkAll();
+  virtual void setAll();
 
 protected:
Index: src/UIElements/QT4/QTDialog.cpp
===================================================================
--- src/UIElements/QT4/QTDialog.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
+++ src/UIElements/QT4/QTDialog.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -0,0 +1,314 @@
+/*
+ * QTDialog.cpp
+ *
+ *  Created on: Jan 18, 2010
+ *      Author: crueger
+ */
+
+#include "UIElements/QT4/QTDialog.hpp"
+
+#include <string>
+#include <sstream>
+#include <limits>
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qspinbox.h>
+#include <QtGui/QDoubleSpinBox>
+#include <Qt/qlineedit.h>
+#include <Qt/qdialogbuttonbox.h>
+#include <Qt/qpushbutton.h>
+#include <Qt/qcombobox.h>
+
+#include "atom.hpp"
+#include "molecule.hpp"
+
+
+using namespace std;
+
+QTDialog::QTDialog() :
+    QDialog(0)
+{
+  // creating and filling of the Dialog window
+  mainLayout = new QVBoxLayout();
+  inputLayout = new QVBoxLayout();
+  buttonLayout = new QVBoxLayout();
+  setLayout(mainLayout);
+  mainLayout->addLayout(inputLayout);
+  mainLayout->addLayout(buttonLayout);
+  buttons = new QDialogButtonBox(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
+  buttonLayout->addWidget(buttons);
+
+  // Disable the ok button until something was entered
+  buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
+
+  // connect the buttons to their appropriate slots
+  connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
+  connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
+}
+
+QTDialog::~QTDialog()
+{
+}
+
+bool QTDialog::display(){
+  // Button state might have changed by some update that
+  // was done during query construction. To make sure
+  // the state is correct, we just call update one more time.
+  update();
+  if(exec()) {
+    setAll();
+    return true;
+  }
+  else {
+    return false;
+  }
+}
+
+void QTDialog::update(){
+  buttons->button(QDialogButtonBox::Ok)->setEnabled(checkAll());
+}
+
+/************************** Query Infrastructure ************************/
+
+void QTDialog::queryInt(const char *title, int *target)
+{
+  registerQuery(new IntQTQuery(title,target,inputLayout,this));
+}
+
+void QTDialog::queryDouble(const char* title, double* target){
+  registerQuery(new DoubleQTQuery(title,target,inputLayout,this));
+}
+
+void QTDialog::queryString(const char* title, std::string *target)
+{
+  registerQuery(new StringQTQuery(title,target,inputLayout,this));
+}
+
+void QTDialog::queryMolecule(const char *title,molecule **target,MoleculeListClass *molecules)
+{
+  registerQuery(new MoleculeQTQuery(title,target,molecules,inputLayout,this));
+}
+
+void QTDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check) {
+  registerQuery(new VectorQTQuery(title,target,cellSize,check,inputLayout,this));
+}
+
+/************************** Query Objects *******************************/
+
+QTDialog::IntQTQuery::IntQTQuery(string _title,int *_target,QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::IntQuery(_title,_target),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QSpinBox();
+  inputBox->setValue(0);
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new IntQTQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->value());
+  connect(inputBox,SIGNAL(valueChanged(int)),pipe,SLOT(update(int)));
+}
+
+QTDialog::IntQTQuery::~IntQTQuery()
+{
+  delete pipe;
+}
+
+// Handling is easy since the GUI makes it impossible to enter invalid values
+bool QTDialog::IntQTQuery::handle()
+{
+  return true;
+}
+
+QTDialog::DoubleQTQuery::DoubleQTQuery(string title,double *_target,QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::DoubleQuery(title,_target),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QDoubleSpinBox();
+  inputBox->setValue(0);
+  inputBox->setRange(-numeric_limits<double>::max(),numeric_limits<double>::max());
+  inputBox->setDecimals(3);
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new DoubleQTQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->value());
+  connect(inputBox,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
+}
+
+QTDialog::DoubleQTQuery::~DoubleQTQuery()
+{
+  delete pipe;
+}
+
+bool QTDialog::DoubleQTQuery::handle() {
+  return true;
+}
+
+
+QTDialog::StringQTQuery::StringQTQuery(string _title,string *_target,QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::StringQuery(_title,_target),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QLineEdit();
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new StringQTQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->text());
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(update(const QString&)));
+}
+
+QTDialog::StringQTQuery::~StringQTQuery()
+{
+  delete pipe;
+}
+
+// All values besides the empty string are valid
+bool QTDialog::StringQTQuery::handle()
+{
+  return tmp!="";
+}
+
+QTDialog::MoleculeQTQuery::MoleculeQTQuery(string _title, molecule **_target, MoleculeListClass *_molecules, QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::MoleculeQuery(_title,_target,_molecules),
+    parent(_parent)
+{
+  MoleculeList::iterator iter;
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  // add all molecules to the combo box
+  for(iter  = molecules->ListOfMolecules.begin();
+      iter != molecules->ListOfMolecules.end();
+      iter++) {
+    stringstream sstr;
+    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new MoleculeQTQueryPipe(&tmp,_dialog,inputBox,_molecules);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QTDialog::MoleculeQTQuery::~MoleculeQTQuery()
+{
+  delete pipe;
+}
+
+// Handling is easy, since the GUI makes it impossible to select invalid values
+bool QTDialog::MoleculeQTQuery::handle()
+{
+  return true;
+}
+
+QTDialog::VectorQTQuery::VectorQTQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check,QBoxLayout *_parent,QTDialog *_dialog) :
+    Dialog::VectorQuery(title,_target,_cellSize,_check),
+    parent(_parent)
+{
+  // About the j: I don't know why it was done this way, but it was used this way in Vector::AskPosition, so I reused it
+  int j = -1;
+  const char *coords[3] = {"x:","y:","z:"};
+  mainLayout= new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  mainLayout->addWidget(titleLabel);
+  subLayout = new QVBoxLayout();
+  mainLayout->addLayout(subLayout);
+  for(int i=0; i<3; i++) {
+    j+=i+1;
+    coordLayout[i] = new QHBoxLayout();
+    subLayout->addLayout(coordLayout[i]);
+    coordLabel[i] = new QLabel(QString(coords[i]));
+    coordLayout[i]->addWidget(coordLabel[i]);
+    coordInput[i] = new QDoubleSpinBox();
+    coordInput[i]->setRange(0,cellSize[j]);
+    coordInput[i]->setDecimals(3);
+    coordLayout[i]->addWidget(coordInput[i]);
+    pipe[i] = new DoubleQTQueryPipe(&((*tmp)[i]),_dialog);
+    pipe[i]->update(coordInput[i]->value());
+    connect(coordInput[i],SIGNAL(valueChanged(double)),pipe[i],SLOT(update(double)));
+
+  }
+  parent->addLayout(mainLayout);
+}
+
+QTDialog::VectorQTQuery::~VectorQTQuery()
+{}
+
+bool QTDialog::VectorQTQuery::handle() {
+  return true;
+}
+
+
+/*************************** Plumbing *******************************/
+
+StringQTQueryPipe::StringQTQueryPipe(string *_content, QTDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+StringQTQueryPipe::~StringQTQueryPipe()
+{}
+
+void StringQTQueryPipe::update(const QString& newText) {
+  content->assign(newText.toStdString());
+  dialog->update();
+}
+
+IntQTQueryPipe::IntQTQueryPipe(int *_content, QTDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+IntQTQueryPipe::~IntQTQueryPipe()
+{}
+
+void IntQTQueryPipe::update(int newInt) {
+  (*content) = newInt;
+  dialog->update();
+}
+
+DoubleQTQueryPipe::DoubleQTQueryPipe(double *_content, QTDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+DoubleQTQueryPipe::~DoubleQTQueryPipe()
+{}
+
+void DoubleQTQueryPipe::update(double newDbl) {
+  (*content) = newDbl;
+  dialog->update();
+}
+
+MoleculeQTQueryPipe::MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox, MoleculeListClass *_molecules) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox),
+  molecules(_molecules)
+{}
+
+MoleculeQTQueryPipe::~MoleculeQTQueryPipe()
+{}
+
+void MoleculeQTQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  (*content) = molecules->ReturnIndex(idx);
+  dialog->update();
+}
+
Index: src/UIElements/QT4/QTDialog.hpp
===================================================================
--- src/UIElements/QT4/QTDialog.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
+++ src/UIElements/QT4/QTDialog.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -0,0 +1,192 @@
+/*
+ * QTDialog.hpp
+ *
+ *  Created on: Jan 18, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTDIALOG_HPP_
+#define QTDIALOG_HPP_
+
+#include "UIElements/Dialog.hpp"
+#include <QtGui/QDialog>
+
+class QBoxLayout;
+class QLabel;
+class QSpinBox;
+class QDoubleSpinBox;
+class QLineEdit;
+class QComboBox;
+class QDialogButtonBox;
+
+
+// Forward declarations for plumbing
+class StringQTQueryPipe;
+class IntQTQueryPipe;
+class DoubleQTQueryPipe;
+class MoleculeQTQueryPipe;
+
+class QTDialog : public QDialog, public Dialog
+{
+  Q_OBJECT
+public:
+  QTDialog();
+  virtual ~QTDialog();
+
+  virtual void queryInt(const char *, int *);
+  virtual void queryString(const char*, std::string *);
+  virtual void queryDouble(const char*,double *);
+  virtual void queryMolecule(const char*,molecule**,MoleculeListClass*);
+  virtual void queryVector(const char*,Vector *,const double *const,bool);
+
+  virtual bool display();
+
+  virtual void update();
+
+protected:
+  class IntQTQuery : public Dialog::IntQuery {
+    public:
+      IntQTQuery(std::string _title, int *_target,QBoxLayout *_parent,QTDialog *_dialog);
+      ~IntQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QSpinBox *inputBox;
+
+      IntQTQueryPipe *pipe;
+    };
+
+    class DoubleQTQuery : public Dialog::DoubleQuery {
+    public:
+      DoubleQTQuery(std::string title, double *_target,QBoxLayout *_parent,QTDialog *_dialog);
+      ~DoubleQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QDoubleSpinBox *inputBox;
+
+      DoubleQTQueryPipe *pipe;
+    };
+
+    class StringQTQuery : public Dialog::StringQuery {
+    public:
+      StringQTQuery(std::string _title, std::string *_target, QBoxLayout *_parent,QTDialog *_dialog);
+      ~StringQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QLineEdit *inputBox;
+
+      StringQTQueryPipe *pipe;
+    };
+
+    class MoleculeQTQuery : public Dialog::MoleculeQuery {
+    public:
+      MoleculeQTQuery(std::string _title, molecule **_target, MoleculeListClass *_molecules, QBoxLayout *_parent,QTDialog *_dialog);
+      ~MoleculeQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QComboBox *inputBox;
+
+      MoleculeQTQueryPipe *pipe;
+    };
+
+    class VectorQTQuery : public Dialog::VectorQuery {
+    public:
+      VectorQTQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check,QBoxLayout *,QTDialog *);
+      ~VectorQTQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *mainLayout;
+      QLabel *titleLabel;
+      QBoxLayout *subLayout;
+      QBoxLayout *coordLayout[3];
+      QLabel *coordLabel[3];
+      QDoubleSpinBox *coordInput[3];
+
+      DoubleQTQueryPipe *pipe[3];
+    };
+
+private:
+  QBoxLayout *mainLayout;
+  QBoxLayout *inputLayout;
+  QBoxLayout *buttonLayout;
+  QDialogButtonBox *buttons;
+};
+
+// All kinds of plumbing for Queries
+// Plumbing needs to be outside of the class where it is needed,
+// since MOC doesn't like nested classes
+
+class StringQTQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  StringQTQueryPipe(std::string *_content, QTDialog *_dialog);
+  ~StringQTQueryPipe();
+
+public slots:
+  void update(const QString&);
+
+private:
+  std::string *content;
+  QTDialog *dialog;
+
+};
+
+class IntQTQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  IntQTQueryPipe(int *_content, QTDialog *_dialog);
+  ~IntQTQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  int *content;
+  QTDialog *dialog;
+
+};
+
+class DoubleQTQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  DoubleQTQueryPipe(double *_content, QTDialog *_dialog);
+  ~DoubleQTQueryPipe();
+
+public slots:
+  void update(double);
+
+private:
+  double *content;
+  QTDialog *dialog;
+
+};
+
+class MoleculeQTQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox, MoleculeListClass *_molecules);
+  ~MoleculeQTQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  molecule **content;
+  MoleculeListClass *molecules;
+  QTDialog *dialog;
+  QComboBox *theBox;
+
+};
+#endif /* QTDIALOG_HPP_ */
Index: src/UIElements/QT4/QTMainWindow.cpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
+++ src/UIElements/QT4/QTMainWindow.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -0,0 +1,61 @@
+/*
+ * QTMainWindow.cpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#include "QTMainWindow.hpp"
+
+#include<Qt/qapplication.h>
+#include<Qt/qlabel.h>
+#include<Qt/qstring.h>
+#include<Qt/qmenubar.h>
+#include<Qt/qsplitter.h>
+
+#include<iostream>
+#include<boost/bind.hpp>
+
+#include "atom.hpp"
+#include "molecule.hpp"
+#include "Menu/QT4/QTMenu.hpp"
+#include "Views/QT4/QTMoleculesView.hpp"
+#include "Views/QT4/GLMoleculeView.hpp"
+
+
+using namespace std;
+
+QTMainWindow::QTMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName,QApplication *_theApp) :
+    theApp(_theApp)
+{
+  QSplitter *splitter1 = new QSplitter (Qt::Horizontal, this );
+  QSplitter *splitter2 = new QSplitter (Qt::Vertical, splitter1 );
+
+  moleculeDisplay = new QTMoleculesView(molecules,splitter2);
+
+  QLabel *pseudo1 = new QLabel(QString("Here be dragons"));
+  molecule3dDisplay = new GLMoleculeView();
+
+  setCentralWidget(splitter1);
+  splitter1->addWidget(splitter2);
+  splitter1->addWidget(pseudo1);
+  splitter2->addWidget(molecule3dDisplay);
+  splitter2->addWidget(moleculeDisplay);
+
+
+
+
+  editMoleculesMenu = new QTMenu("Edit Molecules");
+  populaters.MakeEditMoleculesMenu(editMoleculesMenu,molecules,configuration,periode);
+  menuBar()->addMenu(editMoleculesMenu);
+}
+
+QTMainWindow::~QTMainWindow()
+{
+  // TODO Auto-generated destructor stub
+}
+
+void QTMainWindow::display() {
+  this->show();
+  theApp->exec();
+}
Index: src/UIElements/QT4/QTMainWindow.hpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
+++ src/UIElements/QT4/QTMainWindow.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -0,0 +1,39 @@
+/*
+ * QTMainWindow.hpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTMAINWINDOW_HPP_
+#define QTMAINWINDOW_HPP_
+
+#include "UIElements/MainWindow.hpp"
+#include <QtGui/QMainWindow>
+
+class QTMoleculesView;
+class StringView;
+class QTMenu;
+class GLMoleculeView;
+
+class QTMainWindow : public QMainWindow, public MainWindow
+{
+  Q_OBJECT
+
+public:
+  QTMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration,
+               periodentafel *periode, char *ConfigFileName, QApplication *_theApp);
+  virtual ~QTMainWindow();
+
+  virtual void display();
+
+private:
+  // All kinds of QTStuff used in this window
+  QApplication *theApp;
+  QTMoleculesView *moleculeDisplay;
+  QTMenu *editMoleculesMenu;
+  GLMoleculeView *molecule3dDisplay;
+
+};
+
+#endif /* QTMAINWINDOW_HPP_ */
Index: src/UIElements/QT4/QTUIFactory.cpp
===================================================================
--- src/UIElements/QT4/QTUIFactory.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
+++ src/UIElements/QT4/QTUIFactory.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -0,0 +1,44 @@
+/*
+ * QTUIFactory.cpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#include <iostream>
+#include <cassert>
+
+using namespace std;
+
+#include <qapplication.h>
+
+#include "UIElements/QT4/QTUIFactory.hpp"
+#include "UIElements/QT4/QTMainWindow.hpp"
+#include "UIElements/QT4/QTDialog.hpp"
+#include "defs.hpp"
+
+QTUIFactory::QTUIFactory()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+QTUIFactory::~QTUIFactory()
+{
+  // TODO Auto-generated destructor stub
+}
+
+Dialog* QTUIFactory::makeDialog() {
+  return new QTDialog();
+}
+
+MainWindow* QTUIFactory::makeMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName) {
+  // For now we just fake the command line parameters to make QT happy
+  int argc=1;
+  char **argv;
+  argv = new char*[1];
+  argv[0] = new char[64];
+  strcpy(argv[0],MOLECUILDER_NAME);
+  app = new QApplication(argc,argv);
+  return new QTMainWindow(populaters,molecules,configuration,periode,ConfigFileName,app);
+}
Index: src/UIElements/QT4/QTUIFactory.hpp
===================================================================
--- src/UIElements/QT4/QTUIFactory.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
+++ src/UIElements/QT4/QTUIFactory.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -0,0 +1,32 @@
+/*
+ * QTUIFactory.hpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTUIFACTORY_HPP_
+#define QTUIFACTORY_HPP_
+
+#include "UIElements/UIFactory.hpp"
+
+class QApplication;
+
+class QTUIFactory : public UIFactory
+{
+  friend class UIFactory;
+
+public:
+  virtual ~QTUIFactory();
+
+  virtual Dialog* makeDialog();
+  virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *);
+
+protected:
+  QTUIFactory();
+
+private:
+  QApplication *app;
+};
+
+#endif /* QTUIFACTORY_HPP_ */
Index: src/UIElements/TextDialog.cpp
===================================================================
--- src/UIElements/TextDialog.cpp	(revision 2ededc23ca840f65c2141748eec08536adbb27d6)
+++ src/UIElements/TextDialog.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -114,3 +114,4 @@
 bool TextDialog::VectorTextQuery::handle() {
  tmp->AskPosition(cellSize,check);
+ return true;
 }
Index: src/UIElements/TextUIFactory.hpp
===================================================================
--- src/UIElements/TextUIFactory.hpp	(revision 2ededc23ca840f65c2141748eec08536adbb27d6)
+++ src/UIElements/TextUIFactory.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -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 2ededc23ca840f65c2141748eec08536adbb27d6)
+++ src/UIElements/UIFactory.cpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -12,4 +12,7 @@
 // all factories that can be used:
 #include "UIElements/TextUIFactory.hpp"
+#ifdef USE_GUI_QT
+#include "UIElements/QT4/QTUIFactory.hpp"
+#endif
 
 UIFactory *UIFactory::theFactory = 0;
@@ -32,5 +35,9 @@
       theFactory = new TextUIFactory();
       break;
-
+#ifdef USE_GUI_QT
+    case QT4 :
+      theFactory = new QTUIFactory();
+      break;
+#endif
     default:
       assert(0 && "No such Factory in stock");
Index: src/UIElements/UIFactory.hpp
===================================================================
--- src/UIElements/UIFactory.hpp	(revision 2ededc23ca840f65c2141748eec08536adbb27d6)
+++ src/UIElements/UIFactory.hpp	(revision b8d1aeb22373c5d1fad99d7977d1fe361a9c5313)
@@ -22,5 +22,10 @@
 
 public:
-  enum InterfaceTypes {Text};
+  enum InterfaceTypes {
+    Text,
+#ifdef USE_GUI_QT
+    QT4
+#endif
+};
   virtual ~UIFactory();
 
