[12948c] | 1 | /*
|
---|
| 2 | * Project: MoleCuilder
|
---|
| 3 | * Description: creates and alters molecular systems
|
---|
[0aa122] | 4 | * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
|
---|
[12948c] | 5 | * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | /*
|
---|
| 9 | * UnsignedIntsQtQuery.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 |
|
---|
[a2aa2f] | 20 | #include <Qt/qpushbutton.h>
|
---|
[12948c] | 21 | #include <Qt/qboxlayout.h>
|
---|
| 22 | #include <Qt/qlistwidget.h>
|
---|
| 23 |
|
---|
| 24 | #include "CodePatterns/MemDebug.hpp"
|
---|
| 25 |
|
---|
| 26 | #include "UIElements/Qt4/Query/QtQuery.hpp"
|
---|
[a2aa2f] | 27 | #include "UIElements/Qt4/Query/QtQueryList.hpp"
|
---|
[12948c] | 28 | #include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
|
---|
| 29 |
|
---|
| 30 |
|
---|
[7dfd07] | 31 | QtDialog::UnsignedIntsQtQuery::UnsignedIntsQtQuery(Parameter<std::vector<unsigned int> > &_param, std::string _title,QBoxLayout *_parent,Dialog *_dialog) :
|
---|
[b3a54d] | 32 | Dialog::UnsignedIntsQuery(_param, _title),
|
---|
[a2aa2f] | 33 | QtQueryList<unsigned int>(_parent, _dialog, temp)
|
---|
[12948c] | 34 | {
|
---|
[a2aa2f] | 35 | ListQuerySubDialog *subDialog = new ListQuerySubDialog(this);
|
---|
| 36 | subQuery = new UnsignedIntQtQuery(*subParam, _title, thisVLayout, subDialog);
|
---|
| 37 | subDialog->setSubQuery(subQuery);
|
---|
| 38 |
|
---|
| 39 | connect(inputList,SIGNAL(itemSelectionChanged()),this,SLOT(onElementSelected()));
|
---|
| 40 | connect(addButton,SIGNAL(clicked()),this,SLOT(onAddElement()));
|
---|
| 41 | connect(removeButton,SIGNAL(clicked()),this,SLOT(onRemoveElement()));
|
---|
[12948c] | 42 | }
|
---|
| 43 |
|
---|
| 44 | QtDialog::UnsignedIntsQtQuery::~UnsignedIntsQtQuery()
|
---|
| 45 | {
|
---|
[a2aa2f] | 46 | delete(subQuery);
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | void QtDialog::UnsignedIntsQtQuery::onSubUpdate()
|
---|
| 50 | {
|
---|
| 51 | addButton->setEnabled(subParam->isSet());
|
---|
[12948c] | 52 | }
|
---|
| 53 |
|
---|
[a2aa2f] | 54 | void QtDialog::UnsignedIntsQtQuery::onElementSelected() {
|
---|
| 55 | elementSelected();
|
---|
[7c9921] | 56 | }
|
---|
| 57 |
|
---|
[a2aa2f] | 58 | void QtDialog::UnsignedIntsQtQuery::onAddElement() {
|
---|
| 59 | addElement();
|
---|
| 60 | }
|
---|
| 61 |
|
---|
| 62 | void QtDialog::UnsignedIntsQtQuery::onRemoveElement() {
|
---|
| 63 | removeElements();
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | bool QtDialog::UnsignedIntsQtQuery::handle()
|
---|
| 67 | {
|
---|
[9d5531] | 68 | if (param.isValid(temp)){
|
---|
| 69 | param.set(temp);
|
---|
| 70 | return true;
|
---|
| 71 | }
|
---|
| 72 | return false;
|
---|
[12948c] | 73 | }
|
---|
| 74 |
|
---|
| 75 |
|
---|
[a2aa2f] | 76 |
|
---|