summaryrefslogtreecommitdiff
path: root/utils/regtools/qeditor/utils.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-10-22 18:00:59 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2014-12-15 22:42:43 +0100
commit3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89 (patch)
treed14d4cbacdef29ee48b7b0610929c3a4e81785ba /utils/regtools/qeditor/utils.h
parent0389fd0982d1db132669242bc6e5809bbee43c7c (diff)
downloadrockbox-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.h28
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)
149class SocFieldCachedItemDelegate : public QStyledItemDelegate 149class SocFieldCachedItemDelegate : public QStyledItemDelegate
150{ 150{
151public: 151public:
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
164protected:
165 DisplayMode m_mode;
155}; 166};
156 167
157class SocFieldCachedEditor : public SocFieldEditor 168class SocFieldCachedEditor : public SocFieldEditor
@@ -203,21 +214,12 @@ private:
203 mutable QSize m_size; 214 mutable QSize m_size;
204}; 215};
205 216
206class GrowingTextEdit : public QTextEdit 217class GrowingTableView : public QTableView
207{
208 Q_OBJECT
209public:
210 GrowingTextEdit(QWidget *parent = 0);
211
212protected slots:
213 void TextChanged();
214};
215
216class GrowingTableWidget : public QTableWidget
217{ 218{
218 Q_OBJECT 219 Q_OBJECT
219public: 220public:
220 GrowingTableWidget(QWidget *parent = 0); 221 GrowingTableView(QWidget *parent = 0);
222 virtual void setModel(QAbstractItemModel *model);
221 223
222protected slots: 224protected slots:
223 void DataChanged(const QModelIndex& tl, const QModelIndex& br); 225 void DataChanged(const QModelIndex& tl, const QModelIndex& br);