[8df74d] | 1 | /*
|
---|
| 2 | * Project: MoleCuilder
|
---|
| 3 | * Description: creates and alters molecular systems
|
---|
[0aa122] | 4 | * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
|
---|
[8df74d] | 5 | * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | /*
|
---|
| 9 | * VectorsQtQuery.cpp
|
---|
| 10 | *
|
---|
| 11 | * Created on: Oct 25, 2010
|
---|
| 12 | * Author: heber
|
---|
| 13 | */
|
---|
| 14 |
|
---|
| 15 | // include config.h
|
---|
| 16 | #ifdef HAVE_CONFIG_H
|
---|
| 17 | #include <config.h>
|
---|
| 18 | #endif
|
---|
| 19 |
|
---|
| 20 | #include <QtGui/QDoubleSpinBox>
|
---|
| 21 | #include <Qt/qboxlayout.h>
|
---|
| 22 | #include <Qt/qcombobox.h>
|
---|
| 23 | #include <Qt/qlabel.h>
|
---|
| 24 |
|
---|
[ad011c] | 25 | #include "CodePatterns/MemDebug.hpp"
|
---|
[8df74d] | 26 |
|
---|
[308aa4] | 27 | #include "UIElements/Qt4/Query/QtQuery.hpp"
|
---|
[a5ddf0] | 28 | #include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp"
|
---|
[8df74d] | 29 |
|
---|
| 30 |
|
---|
[7dfd07] | 31 | QtDialog::VectorsQtQuery::VectorsQtQuery(Parameter<std::vector<Vector> > &_param, std::string title, QBoxLayout *_parent,Dialog *_dialog) :
|
---|
[b3a54d] | 32 | Dialog::VectorsQuery(_param, title),
|
---|
[7c9921] | 33 | parent(_parent),
|
---|
| 34 | dialog(_dialog)
|
---|
[8df74d] | 35 | {
|
---|
| 36 | mainLayout= new QHBoxLayout();
|
---|
| 37 | titleLabel = new QLabel(QString(getTitle().c_str()));
|
---|
| 38 | mainLayout->addWidget(titleLabel);
|
---|
| 39 | subLayout = new QVBoxLayout();
|
---|
| 40 | mainLayout->addLayout(subLayout);
|
---|
| 41 | QComboBox* inputBox = new QComboBox();
|
---|
| 42 | coordLayout = new QHBoxLayout();
|
---|
| 43 | subLayout->addLayout(coordLayout);
|
---|
| 44 | coordLabel = new QLabel(QString("x,y,z"));
|
---|
| 45 | coordLayout->addWidget(coordLabel);
|
---|
| 46 | coordInput = new QDoubleSpinBox();
|
---|
| 47 | // coordInput->setRange(0,M.at(i,i));
|
---|
| 48 | coordInput->setDecimals(3);
|
---|
| 49 | coordLayout->addWidget(coordInput);
|
---|
[7dfd07] | 50 | /*pipe = new VectorsQtQueryPipe(temp,_dialog,inputBox);
|
---|
[8df74d] | 51 | //pipe->update(coordInput->value());
|
---|
[7dfd07] | 52 | connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));*/
|
---|
[8df74d] | 53 | parent->addLayout(mainLayout);
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | QtDialog::VectorsQtQuery::~VectorsQtQuery()
|
---|
| 57 | {}
|
---|
| 58 |
|
---|
[7c9921] | 59 | void QtDialog::VectorsQtQuery::onUpdate() {
|
---|
| 60 | dialog->update();
|
---|
| 61 | }
|
---|
| 62 |
|
---|
[8df74d] | 63 | bool QtDialog::VectorsQtQuery::handle() {
|
---|
[9d5531] | 64 | if (param.isValid(temp)){
|
---|
| 65 | param.set(temp);
|
---|
| 66 | return true;
|
---|
| 67 | }
|
---|
| 68 | return false;
|
---|
[8df74d] | 69 | }
|
---|
| 70 |
|
---|
| 71 |
|
---|