From 7318df40f015d1e3fc4ec5353b20817f96bd6329 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 24 Mar 2009 23:29:17 -0400 Subject: Add painting code for PluginTypeModel --- sigtools/PluginTypeModel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sigtools') 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 +#include +#include +#include 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) -- cgit