Make the columns have a sane default width for 'type'

Make the columns on Cylinders edit and Wheight Edit to
have sane values for 'type', this is needed because the
old behavior was to set it fixed size, and the default fixed
size was silly. this calculates a good predefined value
taking the font size in consideration.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-06-16 13:28:59 -03:00
parent f9b4c6b889
commit 20849f014e
3 changed files with 31 additions and 3 deletions

View file

@ -32,10 +32,12 @@ public:
/*reimp*/ int rowCount(const QModelIndex& parent = QModelIndex()) const;
/*reimp*/ bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex());
/*reimp*/ bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
const QString& biggerString() const;
void clear();
void update();
private:
int rows;
QString biggerEntry;
};
/* Encapsulate ws_info */
@ -53,11 +55,12 @@ public:
/*reimp*/ int rowCount(const QModelIndex& parent = QModelIndex()) const;
/*reimp*/ bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex());
/*reimp*/ bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
const QString& biggerString() const;
void clear();
void update();
private:
int rows;
QString biggerEntry;
};
/* Encapsulation of the Cylinder Model, that presents the