Subversion Repositories OpenInventory

Rev

Rev 129 | Rev 138 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 129 Rev 136
Line 170... Line 170...
170
   // int value = index.model()->data(index, Qt::EditRole).toInt();
170
   // int value = index.model()->data(index, Qt::EditRole).toInt();
171
171
172
 //   QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
172
 //   QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
173
 //   spinBox->setValue(value);
173
 //   spinBox->setValue(value);
174
QString value = index.model()->data(index, Qt::EditRole).toString();
174
QString value = index.model()->data(index, Qt::EditRole).toString();
-
 
175
175
QComboBox *comboBox = static_cast<QComboBox*>(editor);
176
QComboBox *comboBox = static_cast<QComboBox*>(editor);
176
177
177
QStringList ID_list;
178
QStringList ID_list;
178
QStringList Name_list;
179
QStringList Name_list;
179
int curr_index;
180
int curr_index;
180
181
181
ID_list = items.keys();
182
ID_list = items.keys();
182
Name_list = items.values();
183
Name_list = items.values();
183
184
184
curr_index = ID_list.indexOf(value);
185
curr_index = ID_list.indexOf(value);
-
 
186
if (curr_index==-1) return;
185
comboBox->setCurrentIndex(curr_index);
187
comboBox->setCurrentIndex(curr_index);
186
/****************************************************
188
/****************************************************
187
if (value == "0") comboBox->setCurrentIndex(0);
189
if (value == "0") comboBox->setCurrentIndex(0);
188
if (value == "1") comboBox->setCurrentIndex(1);
190
if (value == "1") comboBox->setCurrentIndex(1);
189
if (value == "2") comboBox->setCurrentIndex(2);
191
if (value == "2") comboBox->setCurrentIndex(2);
Line 216... Line 218...
216
    QStringList Name_list;
218
    QStringList Name_list;
217
219
218
    QComboBox *comboBox = static_cast<QComboBox*>(editor);
220
    QComboBox *comboBox = static_cast<QComboBox*>(editor);
219
    int currIndex;
221
    int currIndex;
220
    currIndex = comboBox->currentIndex();
222
    currIndex = comboBox->currentIndex();
-
 
223
    if (currIndex==-1) return;
221
  //  QString value = comboBox->itemText(currIndex);
224
  //  QString value = comboBox->itemText(currIndex);
222
225
223
    ID_list = items.keys();
226
    ID_list = items.keys();
224
    Name_list = items.values();
227
    Name_list = items.values();
225
228