1
0
Fork 0
forked from len0rd/rockbox

Revert "regtools/qeditor: use the new model, drop unused code"

This reverts commit 3b3d9bf725.
Gerrit did crap on this one.
This commit is contained in:
Amaury Pouly 2014-12-15 22:44:17 +01:00
parent 3b3d9bf725
commit 94c4834bbb
4 changed files with 111 additions and 67 deletions

View file

@ -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:
GrowingTableView(QWidget *parent = 0);
virtual void setModel(QAbstractItemModel *model);
GrowingTextEdit(QWidget *parent = 0);
protected slots:
void TextChanged();
};
class GrowingTableWidget : public QTableWidget
{
Q_OBJECT
public:
GrowingTableWidget(QWidget *parent = 0);
protected slots:
void DataChanged(const QModelIndex& tl, const QModelIndex& br);