/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010-2012 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * BooleanQtQuery.cpp * * Created on: Oct 25, 2010 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "CodePatterns/MemDebug.hpp" #include "UIElements/Qt4/Query/QtQuery.hpp" #include "UIElements/Qt4/Pipe/BooleanQtQueryPipe.hpp" QtDialog::BooleanQtQuery::BooleanQtQuery(Parameter ¶m, std::string _title, QBoxLayout *_parent, QtDialog *_dialog) : Dialog::BooleanQuery(param, _title), parent(_parent) { if (!param.isSet()) param.set(false); thisLayout = new QHBoxLayout(); titleLabel = new QLabel(QString(getTitle().c_str()),_dialog); booleanCheckBox = new QCheckBox(QString(getTitle().c_str()), _dialog); booleanCheckBox->setCheckState(param.get() ? Qt::Checked : Qt::Unchecked); parent->addLayout(thisLayout); thisLayout->addWidget(titleLabel); thisLayout->addWidget(booleanCheckBox); pipe = new BooleanQtQueryPipe(tmp,_dialog,booleanCheckBox); connect(booleanCheckBox, SIGNAL(stateChanged(int)), pipe, SLOT(update(int))); } QtDialog::BooleanQtQuery::~BooleanQtQuery() { delete pipe; } bool QtDialog::BooleanQtQuery::handle(){ return true; }