summaryrefslogtreecommitdiff
path: root/utils/regtools/qeditor/aux.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-05-11 19:51:55 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2014-05-11 19:56:56 +0200
commit7b590a953639714cf8ea4b550dd7f6558698e23f (patch)
tree4d37890770d45b29237fb671aa66ac446dff7684 /utils/regtools/qeditor/aux.h
parent4c1eafc208426d4457660313314289a570287cb8 (diff)
downloadrockbox-7b590a953639714cf8ea4b550dd7f6558698e23f.tar.gz
rockbox-7b590a953639714cf8ea4b550dd7f6558698e23f.zip
qeditor: many enhancement
Qeditor has been improved in many ways: - it can now dump all registers, just like the lua DUMPER.dump_all() command - several crash were fixed - when connected to a hwstub command, one can correctly edit individual fields - the code was simplified in several places Change-Id: I092b99ce3a12ff6417552de61d62c65f706bcff0
Diffstat (limited to 'utils/regtools/qeditor/aux.h')
-rw-r--r--utils/regtools/qeditor/aux.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/utils/regtools/qeditor/aux.h b/utils/regtools/qeditor/aux.h
index d6a572826c..ee08f1f31b 100644
--- a/utils/regtools/qeditor/aux.h
+++ b/utils/regtools/qeditor/aux.h
@@ -106,6 +106,7 @@ public:
106 106
107 uint field() const; 107 uint field() const;
108 void setField(uint field); 108 void setField(uint field);
109 void SetRegField(const soc_reg_field_t& field) { m_reg_field = field; }
109 110
110protected: 111protected:
111 SocFieldValidator *m_validator; 112 SocFieldValidator *m_validator;
@@ -126,6 +127,55 @@ protected:
126 soc_reg_field_t m_field; 127 soc_reg_field_t m_field;
127}; 128};
128 129
130class SocFieldCachedValue
131{
132public:
133 SocFieldCachedValue():m_value(0) {}
134 SocFieldCachedValue(const soc_reg_field_t& field, uint value)
135 :m_field(field), m_value(value) {}
136 virtual ~SocFieldCachedValue() {}
137 const soc_reg_field_t& field() const { return m_field; }
138 uint value() const { return m_value; }
139protected:
140 soc_reg_field_t m_field;
141 uint m_value;
142};
143
144Q_DECLARE_METATYPE(SocFieldCachedValue)
145
146class SocFieldCachedItemDelegate : public QStyledItemDelegate
147{
148public:
149 SocFieldCachedItemDelegate(QObject *parent = 0):QStyledItemDelegate(parent) {}
150
151 virtual QString displayText(const QVariant& value, const QLocale& locale) const;
152};
153
154class SocFieldCachedEditor : public SocFieldEditor
155{
156 Q_OBJECT
157 Q_PROPERTY(SocFieldCachedValue value READ value WRITE setValue USER true)
158public:
159 SocFieldCachedEditor(QWidget *parent = 0);
160 virtual ~SocFieldCachedEditor();
161
162 SocFieldCachedValue value() const;
163 void setValue(SocFieldCachedValue field);
164protected:
165 SocFieldCachedValue m_value;
166};
167
168class SocFieldCachedEditorCreator : public QItemEditorCreatorBase
169{
170public:
171 SocFieldCachedEditorCreator() {}
172
173 virtual QWidget *createWidget(QWidget *parent) const;
174 virtual QByteArray valuePropertyName() const;
175
176protected:
177};
178
129class RegSexyDisplay : public QWidget 179class RegSexyDisplay : public QWidget
130{ 180{
131 Q_OBJECT 181 Q_OBJECT