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.zip rockbox-3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89.tar.gz rockbox-3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89.tar.bz2 rockbox-3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89.tar.xz | |
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 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); |