summaryrefslogtreecommitdiffstats
path: root/sigtools
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-03-24 23:29:17 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-03-24 23:29:17 -0400
commit7318df40f015d1e3fc4ec5353b20817f96bd6329 (patch)
treeaed82f27b1200b7c5dbc61d0f0340bae3c2875c8 /sigtools
parent56a35e17ed7c704b964ac5ef24f6deee30efbc5a (diff)
downloadsigen-7318df40f015d1e3fc4ec5353b20817f96bd6329.tar.gz
sigen-7318df40f015d1e3fc4ec5353b20817f96bd6329.tar.xz
sigen-7318df40f015d1e3fc4ec5353b20817f96bd6329.zip
Add painting code for PluginTypeModel
Diffstat (limited to 'sigtools')
-rw-r--r--sigtools/PluginTypeModel.cpp5
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)