diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-03-24 23:29:17 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-03-24 23:29:17 -0400 |
commit | 7318df40f015d1e3fc4ec5353b20817f96bd6329 (patch) | |
tree | aed82f27b1200b7c5dbc61d0f0340bae3c2875c8 /sigtools | |
parent | 56a35e17ed7c704b964ac5ef24f6deee30efbc5a (diff) | |
download | sigen-7318df40f015d1e3fc4ec5353b20817f96bd6329.tar.gz sigen-7318df40f015d1e3fc4ec5353b20817f96bd6329.tar.xz sigen-7318df40f015d1e3fc4ec5353b20817f96bd6329.zip |
Add painting code for PluginTypeModel
Diffstat (limited to 'sigtools')
-rw-r--r-- | sigtools/PluginTypeModel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sigtools/PluginTypeModel.cpp b/sigtools/PluginTypeModel.cpp index ff888b87..cfb79f5c 100644 --- a/sigtools/PluginTypeModel.cpp +++ b/sigtools/PluginTypeModel.cpp @@ -24,6 +24,9 @@ // Qt includes #include <QtCore/QSize> +#include <QtGui/QFontMetrics> +#include <QtGui/QPainter> +#include <QtGui/QStyleOptionViewItem> using namespace Sigtools; @@ -45,10 +48,12 @@ Qt::ItemFlags PluginTypeModel::flags() const void PluginTypeModel::paint(QPainter* painter, const QStyleOptionViewItem& option) const { + painter->drawText(option.rect.adjusted(borderWidth, borderWidth, -borderWidth, -borderWidth), m_type); } QSize PluginTypeModel::sizeHint(const QStyleOptionViewItem& option) const { + return QFontMetrics(option.font).size(0, m_type) + 2 * QSize(borderWidth, borderWidth); } BaseModel* PluginTypeModel::childItem(const int row) |