示例#1
0
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();
}
示例#2
0
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();
}
示例#3
0
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();
}