[Companion] Latest changes taken into account

This commit is contained in:
bsongis
2015-03-10 22:58:51 +01:00
parent 8dfeb9826e
commit a61a7228da
13 changed files with 973 additions and 832 deletions
+10 -3
View File
@@ -40,8 +40,7 @@ class AutoComboBox: public QComboBox
this->field = (int *)&field;
this->panel = panel;
for (int i=0; i<count(); ++i) {
setItemData(i, i);
if ((int)field == i)
if ((int)field == itemData(i))
setCurrentIndex(i);
}
}
@@ -50,9 +49,17 @@ class AutoComboBox: public QComboBox
{
this->field = &field;
this->panel = panel;
for (int i=0; i<count(); ++i) {
if ((int)field == itemData(i))
setCurrentIndex(i);
}
}
void setAutoIndexes()
{
for (int i=0; i<count(); ++i) {
setItemData(i, i);
if ((int)field == i)
if (*this->field == i)
setCurrentIndex(i);
}
}