/* * 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. */ /* * BoxQtQuery.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/RealSpaceMatrixQtQueryPipe.hpp" #include "LinearAlgebra/RealSpaceMatrix.hpp" #include "World.hpp" QtDialog::RealSpaceMatrixQtQuery::RealSpaceMatrixQtQuery(Parameter ¶m, std::string _title,QBoxLayout *_parent,QtDialog *_dialog) : Dialog::RealSpaceMatrixQuery(param, _title), parent(_parent) { thisLayout = new QHBoxLayout(); titleLabel = new QLabel(QString(getTitle().c_str())); // init input table inputTable = new QTableWidget(3,3, _dialog); QStringList CoordinateList; CoordinateList << "x" << "y" << "z"; inputTable->setHorizontalHeaderLabels(CoordinateList); inputTable->setVerticalHeaderLabels(CoordinateList); pipe = new RealSpaceMatrixQtQueryPipe(tmp,_dialog, inputTable); // fill the box with current matrix const RealSpaceMatrix &domain = World::getInstance().getDomain().getM(); for (int i=0;i<3;i++) for (int j=0;j<3;j++) { QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg(domain.at(i,j))); inputTable->setItem(i,j,newItem); pipe->update(i,j); } parent->addLayout(thisLayout); thisLayout->addWidget(titleLabel); thisLayout->addWidget(inputTable); connect(inputTable,SIGNAL(cellChanged(int,int)),pipe,SLOT(update(int,int))); } QtDialog::RealSpaceMatrixQtQuery::~RealSpaceMatrixQtQuery() { delete pipe; } bool QtDialog::RealSpaceMatrixQtQuery::handle() { return true; }