- DataTableItemDelegate* aDelegate = 0;
- aDelegate = dynamic_cast<DataTableItemDelegate*>(myDataTblList.first()->itemDelegate());
- if (aDelegate) {
- ModelAPI_AttributeTables::ValueType aOldType = aDelegate->dataType();
- if (aOldType != theIdx) {
- aDelegate->setDataType((ModelAPI_AttributeTables::ValueType)theIdx);
- int aColumns = myDataTblList.first()->columnCount();
- int aRows = myDataTblList.first()->rowCount();
- foreach(QTableWidget* aTable, myDataTblList) {
- for(int i = 1; i < aColumns; i++) {
- for(int j = 0; j < aRows; j++) {
- switch (theIdx) {
- case ModelAPI_AttributeTables::DOUBLE:
- case ModelAPI_AttributeTables::INTEGER:
- if ((aOldType == ModelAPI_AttributeTables::BOOLEAN) ||
- (aOldType == ModelAPI_AttributeTables::STRING)) {
- aTable->item(j, i)->setText("0");
- }
- break;
- case ModelAPI_AttributeTables::BOOLEAN:
- aTable->item(j, i)->setText(MYFalse);
- break;
- case ModelAPI_AttributeTables::STRING:
- aTable->item(j, i)->setText("");
- break;
+ ModelAPI_AttributeTables::ValueType aOldType = myDelegate->dataType();
+ if (aOldType != theIdx) {
+ myDelegate->setDataType((ModelAPI_AttributeTables::ValueType)theIdx);
+ int aColumns = myDataTblList.first()->columnCount();
+ int aRows = myDataTblList.first()->rowCount();
+ foreach(QTableWidget* aTable, myDataTblList) {
+ for(int i = 1; i < aColumns; i++) {
+ for(int j = 0; j < aRows; j++) {
+ switch (theIdx) {
+ case ModelAPI_AttributeTables::DOUBLE:
+ case ModelAPI_AttributeTables::INTEGER:
+ if ((aOldType == ModelAPI_AttributeTables::BOOLEAN) ||
+ (aOldType == ModelAPI_AttributeTables::STRING)) {
+ aTable->item(j, i)->setText("0");