This commit is contained in:
bsongis
2014-11-15 20:02:52 +01:00
parent b79c4ea79e
commit a3f712b3dc
9 changed files with 104 additions and 46 deletions
+13 -2
View File
@@ -25,7 +25,7 @@ class AutoComboBox: public QComboBox
lock = false;
}
void addItem(const QString & item, unsigned int value)
void addItem(const QString & item, int value)
{
lock = true;
QComboBox::addItem(item, value);
@@ -36,6 +36,17 @@ class AutoComboBox: public QComboBox
}
void setField(unsigned int & field, ModelPanel * panel=NULL)
{
this->field = (int *)&field;
this->panel = panel;
for (int i=0; i<count(); ++i) {
setItemData(i, i);
if ((int)field == i)
setCurrentIndex(i);
}
}
void setField(int & field, ModelPanel * panel=NULL)
{
this->field = &field;
this->panel = panel;
@@ -58,7 +69,7 @@ class AutoComboBox: public QComboBox
}
protected:
unsigned int * field;
int * field;
ModelPanel * panel;
bool lock;
};