diff options
Diffstat (limited to 'utils/regtools/qeditor/aux.h')
-rw-r--r-- | utils/regtools/qeditor/aux.h | 50 |
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 | ||
110 | protected: | 111 | protected: |
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 | ||
130 | class SocFieldCachedValue | ||
131 | { | ||
132 | public: | ||
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; } | ||
139 | protected: | ||
140 | soc_reg_field_t m_field; | ||
141 | uint m_value; | ||
142 | }; | ||
143 | |||
144 | Q_DECLARE_METATYPE(SocFieldCachedValue) | ||
145 | |||
146 | class SocFieldCachedItemDelegate : public QStyledItemDelegate | ||
147 | { | ||
148 | public: | ||
149 | SocFieldCachedItemDelegate(QObject *parent = 0):QStyledItemDelegate(parent) {} | ||
150 | |||
151 | virtual QString displayText(const QVariant& value, const QLocale& locale) const; | ||
152 | }; | ||
153 | |||
154 | class SocFieldCachedEditor : public SocFieldEditor | ||
155 | { | ||
156 | Q_OBJECT | ||
157 | Q_PROPERTY(SocFieldCachedValue value READ value WRITE setValue USER true) | ||
158 | public: | ||
159 | SocFieldCachedEditor(QWidget *parent = 0); | ||
160 | virtual ~SocFieldCachedEditor(); | ||
161 | |||
162 | SocFieldCachedValue value() const; | ||
163 | void setValue(SocFieldCachedValue field); | ||
164 | protected: | ||
165 | SocFieldCachedValue m_value; | ||
166 | }; | ||
167 | |||
168 | class SocFieldCachedEditorCreator : public QItemEditorCreatorBase | ||
169 | { | ||
170 | public: | ||
171 | SocFieldCachedEditorCreator() {} | ||
172 | |||
173 | virtual QWidget *createWidget(QWidget *parent) const; | ||
174 | virtual QByteArray valuePropertyName() const; | ||
175 | |||
176 | protected: | ||
177 | }; | ||
178 | |||
129 | class RegSexyDisplay : public QWidget | 179 | class RegSexyDisplay : public QWidget |
130 | { | 180 | { |
131 | Q_OBJECT | 181 | Q_OBJECT |