1 | /*
|
---|
2 | * Project: MoleCuilder
|
---|
3 | * Description: creates and alters molecular systems
|
---|
4 | * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
|
---|
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 |
|
---|
25 | #include "CodePatterns/MemDebug.hpp"
|
---|
26 |
|
---|
27 | #include "UIElements/Qt4/Query/QtQuery.hpp"
|
---|
28 | #include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp"
|
---|
29 |
|
---|
30 |
|
---|
31 | QtDialog::VectorsQtQuery::VectorsQtQuery(Parameter<std::vector<Vector> > &_param, std::string title, QBoxLayout *_parent,Dialog *_dialog) :
|
---|
32 | Dialog::VectorsQuery(_param, title),
|
---|
33 | parent(_parent),
|
---|
34 | dialog(_dialog)
|
---|
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);
|
---|
50 | /*pipe = new VectorsQtQueryPipe(temp,_dialog,inputBox);
|
---|
51 | //pipe->update(coordInput->value());
|
---|
52 | connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));*/
|
---|
53 | parent->addLayout(mainLayout);
|
---|
54 | }
|
---|
55 |
|
---|
56 | QtDialog::VectorsQtQuery::~VectorsQtQuery()
|
---|
57 | {}
|
---|
58 |
|
---|
59 | void QtDialog::VectorsQtQuery::onUpdate() {
|
---|
60 | dialog->update();
|
---|
61 | }
|
---|
62 |
|
---|
63 | bool QtDialog::VectorsQtQuery::handle() {
|
---|
64 | if (param.isValid(temp)){
|
---|
65 | param.set(temp);
|
---|
66 | return true;
|
---|
67 | }
|
---|
68 | return false;
|
---|
69 | }
|
---|
70 |
|
---|
71 |
|
---|