void DPLine::dataChanged() { setPen( QPen( dataColor("line-color"), unsigned( dataInt("line-width") ), getDataPenStyle("line-style"), getDataPenCapStyle("cap-style"), Qt::MiterJoin ) ); postResize(); // in case the pen width has changed update(); }
void DPRectangle::dataChanged() { bool displayBackground = dataBool("background"); QColor line_color = dataColor("line-color"); unsigned width = unsigned( dataInt("line-width") ); Qt::PenStyle style = getDataPenStyle("line-style"); setPen( QPen( line_color, width, style ) ); if (displayBackground) setBrush( dataColor("background-color") ); else setBrush( Qt::NoBrush ); postResize(); update(); }
void Item::setSize( QRect sizeRect, bool forceItemPoints ) { if ( !canvas() ) return; if ( m_sizeRect == sizeRect && !forceItemPoints ) return; if ( !preResize(sizeRect) ) return; canvas()->setChanged(areaPoints().boundingRect()); m_sizeRect = sizeRect; if ( m_itemPoints.isEmpty() || forceItemPoints ) { setItemPoints( QPolygon( m_sizeRect ), false ); } canvas()->setChanged(areaPoints().boundingRect()); postResize(); emit resized(); }