| [3027f8] | 1 | /*
|
|---|
| 2 | * QTMainWindow.cpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Jan 14, 2010
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #include "QTMainWindow.hpp"
|
|---|
| 9 |
|
|---|
| [8f67e2] | 10 | #include<Qt/qapplication.h>
|
|---|
| [fa27ed] | 11 | #include<Qt/qlabel.h>
|
|---|
| 12 | #include<Qt/qstring.h>
|
|---|
| 13 | #include<Qt/qmenubar.h>
|
|---|
| [cef1d7] | 14 | #include<Qt/qsplitter.h>
|
|---|
| [8f67e2] | 15 |
|
|---|
| [3027f8] | 16 | #include<iostream>
|
|---|
| [fa27ed] | 17 | #include<boost/bind.hpp>
|
|---|
| 18 |
|
|---|
| 19 | #include "atom.hpp"
|
|---|
| 20 | #include "molecule.hpp"
|
|---|
| 21 | #include "Menu/QT4/QTMenu.hpp"
|
|---|
| [63b56a7] | 22 | #include "Views/QT4/QTWorldView.hpp"
|
|---|
| [cef1d7] | 23 | #include "Views/QT4/GLMoleculeView.hpp"
|
|---|
| [a77c96] | 24 | #include "Views/QT4/QTMoleculeView.hpp"
|
|---|
| [326a43b] | 25 | #include "Views/QT4/QTStatusBar.hpp"
|
|---|
| [fa27ed] | 26 |
|
|---|
| [3027f8] | 27 |
|
|---|
| 28 | using namespace std;
|
|---|
| 29 |
|
|---|
| [8f67e2] | 30 | QTMainWindow::QTMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName,QApplication *_theApp) :
|
|---|
| 31 | theApp(_theApp)
|
|---|
| [fa27ed] | 32 | {
|
|---|
| [cef1d7] | 33 | QSplitter *splitter1 = new QSplitter (Qt::Horizontal, this );
|
|---|
| 34 | QSplitter *splitter2 = new QSplitter (Qt::Vertical, splitter1 );
|
|---|
| 35 |
|
|---|
| [63b56a7] | 36 | worldDisplay = new QTWorldView(molecules,splitter2);
|
|---|
| [cef1d7] | 37 |
|
|---|
| [a77c96] | 38 | moleculeDisplay = new QTMoleculeView();
|
|---|
| [cef1d7] | 39 | molecule3dDisplay = new GLMoleculeView();
|
|---|
| 40 |
|
|---|
| 41 | setCentralWidget(splitter1);
|
|---|
| 42 | splitter1->addWidget(splitter2);
|
|---|
| [a77c96] | 43 | splitter1->addWidget(moleculeDisplay);
|
|---|
| [cef1d7] | 44 | splitter2->addWidget(molecule3dDisplay);
|
|---|
| [63b56a7] | 45 | splitter2->addWidget(worldDisplay);
|
|---|
| [cef1d7] | 46 |
|
|---|
| [326a43b] | 47 | statusBar = new QTStatusBar(this);
|
|---|
| 48 | setStatusBar(statusBar);
|
|---|
| [fa27ed] | 49 |
|
|---|
| 50 | editMoleculesMenu = new QTMenu("Edit Molecules");
|
|---|
| 51 | populaters.MakeEditMoleculesMenu(editMoleculesMenu,molecules,configuration,periode);
|
|---|
| 52 | menuBar()->addMenu(editMoleculesMenu);
|
|---|
| [a77c96] | 53 |
|
|---|
| 54 | connect(worldDisplay,SIGNAL(moleculeSelected(molecule*)),moleculeDisplay,SLOT(moleculeSelected(molecule*)));
|
|---|
| 55 | connect(worldDisplay,SIGNAL(moleculeUnSelected(molecule*)),moleculeDisplay,SLOT(moleculeUnSelected(molecule*)));
|
|---|
| [fa27ed] | 56 | }
|
|---|
| [3027f8] | 57 |
|
|---|
| 58 | QTMainWindow::~QTMainWindow()
|
|---|
| [6a661c] | 59 | {}
|
|---|
| [3027f8] | 60 |
|
|---|
| 61 | void QTMainWindow::display() {
|
|---|
| [8f67e2] | 62 | this->show();
|
|---|
| 63 | theApp->exec();
|
|---|
| [3027f8] | 64 | }
|
|---|