diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-10-22 18:00:59 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-12-15 22:42:43 +0100 |
commit | 3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89 (patch) | |
tree | d14d4cbacdef29ee48b7b0610929c3a4e81785ba /utils/regtools/qeditor/utils.h | |
parent | 0389fd0982d1db132669242bc6e5809bbee43c7c (diff) | |
download | rockbox-3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89.tar.gz rockbox-3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89.zip |
regtools/qeditor: use the new model, drop unused code
Change-Id: Ic4e2e201f6d055c85d52b7fe15d25980386df5b8
Reviewed-on: http://gerrit.rockbox.org/1023
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
Diffstat (limited to 'utils/regtools/qeditor/utils.h')
-rw-r--r-- | utils/regtools/qeditor/utils.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/utils/regtools/qeditor/utils.h b/utils/regtools/qeditor/utils.h index 970010233a..6612ce20a4 100644 --- a/utils/regtools/qeditor/utils.h +++ b/utils/regtools/qeditor/utils.h | |||
@@ -149,9 +149,20 @@ Q_DECLARE_METATYPE(SocFieldCachedValue) | |||
149 | class SocFieldCachedItemDelegate : public QStyledItemDelegate | 149 | class SocFieldCachedItemDelegate : public QStyledItemDelegate |
150 | { | 150 | { |
151 | public: | 151 | public: |
152 | SocFieldCachedItemDelegate(QObject *parent = 0):QStyledItemDelegate(parent) {} | 152 | enum DisplayMode |
153 | { | ||
154 | DisplayValueAndName, /* "value (name)" or "value" if no name */ | ||
155 | DisplayName, /* "name" or "value" if no name */ | ||
156 | DisplayValue, /* "value" */ | ||
157 | }; | ||
153 | 158 | ||
159 | SocFieldCachedItemDelegate(QObject *parent = 0):QStyledItemDelegate(parent) {} | ||
154 | virtual QString displayText(const QVariant& value, const QLocale& locale) const; | 160 | virtual QString displayText(const QVariant& value, const QLocale& locale) const; |
161 | void SetMode(DisplayMode mode) { m_mode = mode; } | ||
162 | DisplayMode GetMode() const { return m_mode; } | ||
163 | |||
164 | protected: | ||
165 | DisplayMode m_mode; | ||
155 | }; | 166 | }; |
156 | 167 | ||
157 | class SocFieldCachedEditor : public SocFieldEditor | 168 | class SocFieldCachedEditor : public SocFieldEditor |
@@ -203,21 +214,12 @@ private: | |||
203 | mutable QSize m_size; | 214 | mutable QSize m_size; |
204 | }; | 215 | }; |
205 | 216 | ||
206 | class GrowingTextEdit : public QTextEdit | 217 | class GrowingTableView : public QTableView |
207 | { | ||
208 | Q_OBJECT | ||
209 | public: | ||
210 | GrowingTextEdit(QWidget *parent = 0); | ||
211 | |||
212 | protected slots: | ||
213 | void TextChanged(); | ||
214 | }; | ||
215 | |||
216 | class GrowingTableWidget : public QTableWidget | ||
217 | { | 218 | { |
218 | Q_OBJECT | 219 | Q_OBJECT |
219 | public: | 220 | public: |
220 | GrowingTableWidget(QWidget *parent = 0); | 221 | GrowingTableView(QWidget *parent = 0); |
222 | virtual void setModel(QAbstractItemModel *model); | ||
221 | 223 | ||
222 | protected slots: | 224 | protected slots: |
223 | void DataChanged(const QModelIndex& tl, const QModelIndex& br); | 225 | void DataChanged(const QModelIndex& tl, const QModelIndex& br); |