From: <le...@us...> - 2007-01-21 17:23:52
|
Revision: 220 http://svn.sourceforge.net/qcell/?rev=220&view=rev Author: lessm Date: 2007-01-21 09:23:50 -0800 (Sun, 21 Jan 2007) Log Message: ----------- - FunctionTable class can edit loaded function Modified Paths: -------------- trunk/qcell/baseheaders/functiontable.h trunk/qcell/baseheaders/functiontable.ui trunk/qcell/basesources/functiontable.cpp trunk/qcell/basesources/simulationwindow.cpp Modified: trunk/qcell/baseheaders/functiontable.h =================================================================== --- trunk/qcell/baseheaders/functiontable.h 2007-01-21 17:21:10 UTC (rev 219) +++ trunk/qcell/baseheaders/functiontable.h 2007-01-21 17:23:50 UTC (rev 220) @@ -27,6 +27,9 @@ void setFunctionPointer(LocalFunction *f); +protected slots: + void functionEdit(int row, int column); + }; #endif // FUNCTIONTABLE_H Modified: trunk/qcell/baseheaders/functiontable.ui =================================================================== --- trunk/qcell/baseheaders/functiontable.ui 2007-01-21 17:21:10 UTC (rev 219) +++ trunk/qcell/baseheaders/functiontable.ui 2007-01-21 17:23:50 UTC (rev 220) @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>388</width> - <height>310</height> + <width>400</width> + <height>300</height> </rect> </property> <property name="windowTitle" > Modified: trunk/qcell/basesources/functiontable.cpp =================================================================== --- trunk/qcell/basesources/functiontable.cpp 2007-01-21 17:21:10 UTC (rev 219) +++ trunk/qcell/basesources/functiontable.cpp 2007-01-21 17:23:50 UTC (rev 220) @@ -34,15 +34,25 @@ : QWidget(parent) { ui.setupUi(this); + connect(ui.functionTable, SIGNAL(cellChanged (int, int)), SLOT(functionEdit(int, int))); } FunctionTable::~FunctionTable() { - } void FunctionTable::setFunctionPointer(LocalFunction *f) { function = f; init(); -} \ No newline at end of file +} + +void FunctionTable::functionEdit(int row, int column) +{ + QString temp; + QTableWidgetItem *item; + item = ui.functionTable->item(row, column); + temp.setNum(item->text().toInt()); + item->setText(temp); + function->setValueAt(temp.toInt(), row * ui.functionTable->columnCount() + column); +} Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-21 17:21:10 UTC (rev 219) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-21 17:23:50 UTC (rev 220) @@ -82,6 +82,7 @@ ui.view3D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); ui.view2DGraph->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); ui.symbolConfig->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); + ui.functionTab->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); renderer->move(1, 1); renderer->resize(ui.view3D->width() - 1, ui.view3D->height() - 1); @@ -103,9 +104,6 @@ view3DTools->move(width() - 116, basetools->height() + 1); view2DTextTools->move(width() - 116, basetools->height() + 1); view1DTextTools->move(width() - 116, basetools->height() + 1); - - - } void simulationWindow::paintEvent(QPaintEvent * event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |