src/colorSelectDialog.cpp

changeset 354
b32d4d66cb6e
parent 327
9ea604af1319
child 364
7c3af0a6f8ab
equal deleted inserted replaced
353:07b3753baedc 354:b32d4d66cb6e
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 }

mercurial