1
0
Fork 0
forked from len0rd/rockbox

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>
This commit is contained in:
Amaury Pouly 2014-10-22 18:00:59 +02:00
parent 0389fd0982
commit 3b3d9bf725
4 changed files with 67 additions and 111 deletions

View file

@ -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
class GrowingTableView : public QTableView
{
Q_OBJECT
public:
GrowingTextEdit(QWidget *parent = 0);
protected slots:
void TextChanged();
};
class GrowingTableWidget : public QTableWidget
{
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);