Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/KisPaletteModel.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | 54 | | |||
55 | void KisPaletteModel::slotDisplayConfigurationChanged() | 55 | void KisPaletteModel::slotDisplayConfigurationChanged() | ||
56 | { | 56 | { | ||
57 | reset(); | 57 | reset(); | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | QVariant KisPaletteModel::data(const QModelIndex& index, int role) const | 60 | QVariant KisPaletteModel::data(const QModelIndex& index, int role) const | ||
61 | { | 61 | { | ||
62 | if (m_colorSet) { | 62 | if (m_colorSet && m_displayRenderer) { | ||
63 | quint32 i = (quint32)(index.row()*columnCount()+index.column()); | 63 | quint32 i = (quint32)(index.row()*columnCount()+index.column()); | ||
64 | if (i < m_colorSet->nColors()) { | 64 | if (i < m_colorSet->nColors()) { | ||
65 | switch (role) { | 65 | switch (role) { | ||
66 | case Qt::DisplayRole: { | 66 | case Qt::DisplayRole: { | ||
67 | return m_colorSet->getColorGlobal(i).name; | 67 | return m_colorSet->getColorGlobal(i).name; | ||
68 | } | 68 | } | ||
69 | case Qt::BackgroundRole: { | 69 | case Qt::BackgroundRole: { | ||
70 | QColor color = m_displayRenderer->toQColor(m_colorSet->getColorGlobal(i).color); | 70 | QColor color = m_displayRenderer->toQColor(m_colorSet->getColorGlobal(i).color); | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |