114 m_scene->addRect( x, y, w, w, pen, col ); |
114 m_scene->addRect( x, y, w, w, pen, col ); |
115 QGraphicsTextItem* numtext = m_scene->addText( fmt( "%1", i )); |
115 QGraphicsTextItem* numtext = m_scene->addText( fmt( "%1", i )); |
116 numtext->setDefaultTextColor(( luma( col ) < 80 ) ? Qt::white : Qt::black ); |
116 numtext->setDefaultTextColor(( luma( col ) < 80 ) ? Qt::white : Qt::black ); |
117 numtext->setPos( x, y ); |
117 numtext->setPos( x, y ); |
118 |
118 |
119 if( i == sel()->index ) |
119 if( sel() && i == sel()->index ) |
120 { |
120 { |
121 auto curspic = m_scene->addPixmap( getIcon( "colorcursor" )); |
121 auto curspic = m_scene->addPixmap( getIcon( "colorcursor" )); |
122 curspic->setPos( x, y ); |
122 curspic->setPos( x, y ); |
123 } |
123 } |
124 } |
124 } |