Changeset View
Changeset View
Standalone View
Standalone View
src/itemviews/palettedelegate.cpp
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU General Public License * | 14 | * You should have received a copy of the GNU General Public License * | ||
15 | * along with this program; if not, write to the * | 15 | * along with this program; if not, write to the * | ||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
18 | *********************************************************************************/ | 18 | *********************************************************************************/ | ||
19 | 19 | | |||
20 | #include "palettedelegate.h" | 20 | #include "palettedelegate.h" | ||
21 | 21 | | |||
22 | #include <QtGui/QPainter> | 22 | #include <QPainter> | ||
23 | 23 | | |||
24 | #include "colorutil.h" | 24 | #include "colorutil.h" | ||
25 | #include "palettemodel.h" | 25 | #include "palettemodel.h" | ||
26 | #include "palettedelegateeditors.h" | 26 | #include "palettedelegateeditors.h" | ||
27 | 27 | | |||
28 | PaletteDelegate::PaletteDelegate(QObject * parent) | 28 | PaletteDelegate::PaletteDelegate(QObject * parent) | ||
29 | : QItemDelegate(parent) | 29 | : QItemDelegate(parent) | ||
30 | { | 30 | { | ||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 123 | { | |||
125 | painter->setPen(ColorUtil::contrastColor(ColorUtil::backgroundColorOfWindow())); | 125 | painter->setPen(ColorUtil::contrastColor(ColorUtil::backgroundColorOfWindow())); | ||
126 | brush.setColor(Qt::black); | 126 | brush.setColor(Qt::black); | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | painter->fillRect(option.rect, brush); | 129 | painter->fillRect(option.rect, brush); | ||
130 | painter->drawText(option.rect, Qt::AlignCenter, index.model()->data(index).toMap().value("comment").toString()); | 130 | painter->drawText(option.rect, Qt::AlignCenter, index.model()->data(index).toMap().value("comment").toString()); | ||
131 | } | 131 | } | ||
132 | } | 132 | } | ||
133 | | ||||
134 | #include "palettedelegate.moc" | |