From 94c4834bbbcda9ef71ec8d5ff080b41374d8e7c0 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 15 Dec 2014 22:44:17 +0100 Subject: Revert "regtools/qeditor: use the new model, drop unused code" This reverts commit 3b3d9bf725a5b04e4cd9bc4254fbd2594b518e89. Gerrit did crap on this one. --- utils/regtools/qeditor/utils.h | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'utils/regtools/qeditor/utils.h') diff --git a/utils/regtools/qeditor/utils.h b/utils/regtools/qeditor/utils.h index 6612ce2..9700102 100644 --- a/utils/regtools/qeditor/utils.h +++ b/utils/regtools/qeditor/utils.h @@ -149,20 +149,9 @@ Q_DECLARE_METATYPE(SocFieldCachedValue) class SocFieldCachedItemDelegate : public QStyledItemDelegate { public: - 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; + virtual QString displayText(const QVariant& value, const QLocale& locale) const; }; class SocFieldCachedEditor : public SocFieldEditor @@ -214,12 +203,21 @@ private: mutable QSize m_size; }; -class GrowingTableView : public QTableView +class GrowingTextEdit : public QTextEdit +{ + Q_OBJECT +public: + GrowingTextEdit(QWidget *parent = 0); + +protected slots: + void TextChanged(); +}; + +class GrowingTableWidget : public QTableWidget { Q_OBJECT public: - GrowingTableView(QWidget *parent = 0); - virtual void setModel(QAbstractItemModel *model); + GrowingTableWidget(QWidget *parent = 0); protected slots: void DataChanged(const QModelIndex& tl, const QModelIndex& br); -- cgit v1.1