Example #1
0
void ParameterTable::slotCellChanged(int row, int col)
{
  if (col != 2 && col != 3) return; //Other cols shouldn't change, anyway.

  size_t i, imax = mIndex2Line.size();

  for (i = imax - 1; i != C_INVALID_INDEX; --i)
    if ((int) mIndex2Line[i] <= row) break;

  QString newVal = item(row, col)->text();

  QStringList comboList = *mpComboDelegate->getItems(row);

  if (col == 2 && comboList[0] == "--local--") //is Parameter
    {
      emit parameterStatusChanged((int) i, (newVal == "--local--"));

      if (newVal == "--local--")
        newVal = "0"; // item(row, 3)->text();
    }

  emit signalChanged((int) i, row - (int) mIndex2Line[i], newVal);
}
Example #2
0
void ParameterTable::slotCellChanged(int row, int col)
{
  // find the index of the parameter
  size_t i, imax = mIndex2Line.size();

  for (i = imax - 1; i != C_INVALID_INDEX; --i)
    if ((int) mIndex2Line[i] <= row) break;

  //handle the check boxes
  if (col == 2) //only checkboxes is this column
    {
      if (item(row, col)->flags() | Qt::ItemIsUserCheckable)
        {
          emit parameterStatusChanged((int) i, (item(row, col)->checkState() == Qt::Unchecked) ? false : true);
        }

      return;
    }
  else
    {
      emit signalChanged((int) i, row - (int) mIndex2Line[i], item(row, col)->text());
    }
}