From: <mrj...@us...> - 2008-08-31 20:07:46
|
Revision: 2965 http://tora.svn.sourceforge.net/tora/?rev=2965&view=rev Author: mrjohnson0 Date: 2008-08-31 20:07:50 +0000 (Sun, 31 Aug 2008) Log Message: ----------- set model on change Modified Paths: -------------- trunk/tora/src/toresultdatasingle.cpp trunk/tora/src/toresultdatasingle.h Modified: trunk/tora/src/toresultdatasingle.cpp =================================================================== --- trunk/tora/src/toresultdatasingle.cpp 2008-08-31 20:06:17 UTC (rev 2964) +++ trunk/tora/src/toresultdatasingle.cpp 2008-08-31 20:07:50 UTC (rev 2965) @@ -117,17 +117,18 @@ btn->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed)); connect(btn, SIGNAL(clicked(int)), this, SLOT(showMemo(int))); connect(box, SIGNAL(toggled(bool)), btn, SLOT(setDisabled(bool))); + connect(box, SIGNAL(toggled(bool)), this, SLOT(saveRow())); + connect(edit, SIGNAL(editingFinished()), this, SLOT(saveRow())); grid->addWidget(btn, row, col++); Value.append(edit); Null.append(box); } - // add widget at bottom of grid that can resize + // add widget at bottom of grid so it can resize grid->addWidget(new QLabel(this), row, 0); grid->setRowStretch(row, 1); - Row = _row; changeRow(Row); } @@ -139,10 +140,9 @@ QList<QLineEdit *>::iterator val = Value.begin(); for (int i = 1; - i < Model->columnCount() && chk != Null.end() && val != Value.end(); - i++, chk++, val++) + i < Model->columnCount() && chk != Null.end() && val != Value.end(); + i++, chk++, val++) { - QVariant str = Model->data(row, i); if (!str.isNull()) any = true; Modified: trunk/tora/src/toresultdatasingle.h =================================================================== --- trunk/tora/src/toresultdatasingle.h 2008-08-31 20:06:17 UTC (rev 2964) +++ trunk/tora/src/toresultdatasingle.h 2008-08-31 20:07:50 UTC (rev 2965) @@ -70,10 +70,14 @@ void changeSource(toResultModel *, int row); void changeRow(int row); - void saveRow(void); + inline int currentRow(void) const { + return Row; + } + private slots: virtual void showMemo(int row); + void saveRow(void); }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |