diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-10-22 17:56:13 +0200 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-12-15 22:54:13 +0100 |
| commit | 88053b88325318a2769086438ce4740c5bb7a7aa (patch) | |
| tree | f5a3754e23eb32211fd1bc01911aeda811e0d162 /utils/regtools/qeditor/utils.cpp | |
| parent | 04e798eddf43c81685324e83a655e62434f6fcce (diff) | |
| download | rockbox-88053b88325318a2769086438ce4740c5bb7a7aa.zip rockbox-88053b88325318a2769086438ce4740c5bb7a7aa.tar.gz rockbox-88053b88325318a2769086438ce4740c5bb7a7aa.tar.bz2 rockbox-88053b88325318a2769086438ce4740c5bb7a7aa.tar.xz | |
regtools/qeditor: fix field editor not updating the validator on change
Change-Id: Ib8df47c8b7cfe0beb486e45542e3fcc9187bcc54
Reviewed-on: http://gerrit.rockbox.org/1020
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
Diffstat (limited to 'utils/regtools/qeditor/utils.cpp')
| -rw-r--r-- | utils/regtools/qeditor/utils.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/regtools/qeditor/utils.cpp b/utils/regtools/qeditor/utils.cpp index effd79e..1e39903 100644 --- a/utils/regtools/qeditor/utils.cpp +++ b/utils/regtools/qeditor/utils.cpp @@ -340,6 +340,26 @@ void SocFieldEditor::setField(uint field) setText(QString("0x%1").arg(field, digits, 16, QChar('0'))); } +void SocFieldEditor::SetRegField(const soc_reg_field_t& field) +{ + setValidator(0); + delete m_validator; + m_validator = new SocFieldValidator(field); + setValidator(m_validator); + m_reg_field = field; +} + +/** + * SocFieldCachedValue + */ +SocFieldCachedValue::SocFieldCachedValue(const soc_reg_field_t& field, uint value) + :m_field(field), m_value(value) +{ + int idx = field.find_value(value); + if(idx != -1) + m_name = QString::fromStdString(field.value[idx].name); +} + /** * SocFieldCachedItemDelegate */ |