Dear All

here is my code
The i value always retruning "0"
but the column value contains "1" also.

what mistake in the below code? why i return always zero?

Qt Code:
  1. void Edit::OpenEditor(QListWidgetItem* item1)
  2. {
  3. int rowno = activeRow();
  4. RowItems = iDBConnect->Selecting();
  5.  
  6. if(selectedRow == previousRow)
  7. {
  8. QString string1 = item1->text();
  9. iFilterUpdate = new FilterUpdate();
  10. iFilterUpdate->ui.lineEdit->setText(string1);
  11. FilterNumb* item = RowItems[rowno];
  12. iFilterUpdate->activeRow(item->id);
  13. TInt i;
  14. QSqlQuery query;
  15. query.exec(QString("select Enable from FilterNumTable where id = %1")
  16. .arg(item->id));
  17. if (query.next())
  18. {
  19. i = query.value(2).toBool();
  20. }
  21. if(i)
  22. {
  23. iFilterUpdate->ui.CheckEnable->setCheckState(Qt::Checked);
  24. }
  25. else
  26. {
  27. iFilterUpdate->ui.CheckDisable->setCheckState(Qt::Checked);
  28. }
  29.  
  30. this->close();
  31. }
  32. else
  33. {
  34. previousRow = selectedRow;
  35. }
  36. }
To copy to clipboard, switch view to plain text mode