From 3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 22 Oct 2014 18:00:59 +0200 Subject: regtools/qeditor: use the new model, drop unused code Change-Id: Ic4e2e201f6d055c85d52b7fe15d25980386df5b8 Reviewed-on: http://gerrit.rockbox.org/1023 Reviewed-by: Amaury Pouly --- utils/regtools/qeditor/utils.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'utils/regtools/qeditor/utils.h') diff --git a/utils/regtools/qeditor/utils.h b/utils/regtools/qeditor/utils.h index 9700102..6612ce2 100644 --- a/utils/regtools/qeditor/utils.h +++ b/utils/regtools/qeditor/utils.h @@ -149,9 +149,20 @@ Q_DECLARE_METATYPE(SocFieldCachedValue) class SocFieldCachedItemDelegate : public QStyledItemDelegate { public: - SocFieldCachedItemDelegate(QObject *parent = 0):QStyledItemDelegate(parent) {} + enum DisplayMode + { + DisplayValueAndName, /* "value (name)" or "value" if no name */ + DisplayName, /* "name" or "value" if no name */ + DisplayValue, /* "value" */ + }; + SocFieldCachedItemDelegate(QObject *parent = 0):QStyledItemDelegate(parent) {} virtual QString displayText(const QVariant& value, const QLocale& locale) const; + void SetMode(DisplayMode mode) { m_mode = mode; } + DisplayMode GetMode() const { return m_mode; } + +protected: + DisplayMode m_mode; }; class SocFieldCachedEditor : public SocFieldEditor @@ -203,21 +214,12 @@ private: mutable QSize m_size; }; -class GrowingTextEdit : public QTextEdit -{ - Q_OBJECT -public: - GrowingTextEdit(QWidget *parent = 0); - -protected slots: - void TextChanged(); -}; - -class GrowingTableWidget : public QTableWidget +class GrowingTableView : public QTableView { Q_OBJECT public: - GrowingTableWidget(QWidget *parent = 0); + GrowingTableView(QWidget *parent = 0); + virtual void setModel(QAbstractItemModel *model); protected slots: void DataChanged(const QModelIndex& tl, const QModelIndex& br); -- cgit v1.1