00001 #ifndef UNITCOMBOBOX_H 00002 #define UNITCOMBOBOX_H 00003 00004 #include <QComboBox> 00005 00006 class ConvertableUnitModel; 00007 00014 class UnitComboBox : public QComboBox { 00015 public: 00016 UnitComboBox(ConvertableUnitModel *model, QWidget *parent = 0); 00017 void setTreeIdConstraint(const int &tree_id, const bool &constrainUnitTo = true, const bool &showUnitFrom = true, const bool &calibrationUnit = false); 00018 void setCurrentUnitFromId(int unit_from_id); 00019 int currentUnitFromId() const; 00020 int currentUnitToId() const; 00021 void reset(); 00022 void setModel(ConvertableUnitModel *model); 00023 ConvertableUnitModel *model(); 00024 00025 private: 00026 void setCurrentConstrainedIndex(); 00027 }; 00028 00029 #endif // UNITCOMBOBOX_H