1
/***************************************************************************
2
* Copyright (C) 2003 by Stephen Allewell *
3
* stephen@mirramar.fsnet.co.uk *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
***************************************************************************/
12
#include <qnamespace.h>
14
#include "flosslistboxitem.h"
16
FlossListBoxItem::FlossListBoxItem(QListBox* listBox,Floss* f)
17
: QListBoxItem(listBox),
23
FlossListBoxItem::~FlossListBoxItem()
28
int FlossListBoxItem::height(const QListBox *) const
33
int FlossListBoxItem::width(const QListBox *) const
38
void FlossListBoxItem::paint(QPainter *p)
40
/** draws the list box item as a block of the color followed by the color code and description
44
p->fillRect(0,0,50,18,QBrush(floss->color));
46
p->setPen(Qt::lightGray);
47
QString s = QString("%1 %2 %3").arg(floss->name).arg(floss->description).arg(m_calibrated?i18n("(Calibrated)"):"");
52
void FlossListBoxItem::setCalibrated(bool c)
55
listBox()->triggerUpdate(false);
58
bool FlossListBoxItem::isCalibrated()