27 mUseSymbolV2( false ),
28 mShapeStyleSymbol( 0 )
38 mUseSymbolV2( false ),
39 mShapeStyleSymbol( 0 )
75 properties.insert(
"color",
"white" );
76 properties.insert(
"style",
"solid" );
77 properties.insert(
"style_border",
"solid" );
78 properties.insert(
"color_border",
"black" );
79 properties.insert(
"width_border",
"0.3" );
85 Q_UNUSED( itemStyle );
111 p->setRenderHint( QPainter::Antialiasing );
116 p->drawEllipse( QRectF( 0, 0 , rect().width(), rect().height() ) );
126 p->drawRect( QRectF( 0, 0 , rect().width(), rect().height() ) );
131 triangle << QPointF( 0, rect().height() );
132 triangle << QPointF( rect().width() , rect().height() );
133 triangle << QPointF( rect().width() / 2.0, 0 );
134 p->drawPolygon( triangle );
143 p->setRenderHint( QPainter::Antialiasing );
158 QList<QPolygonF> rings;
159 QPolygonF shapePolygon;
163 QTransform t = QTransform::fromScale( 100, 100 );
165 QTransform ti = t.inverted();
172 QPainterPath ellipsePath;
173 ellipsePath.addEllipse( QRectF( 0, 0 , rect().width(), rect().height() ) );
174 QPolygonF ellipsePoly = ellipsePath.toFillPolygon( t );
175 shapePolygon = ti.map( ellipsePoly );
183 QPainterPath roundedRectPath;
185 QPolygonF roundedPoly = roundedRectPath.toFillPolygon( t );
186 shapePolygon = ti.map( roundedPoly );
190 shapePolygon = QPolygonF( QRectF( 0, 0, rect().width(), rect().height() ) );
196 shapePolygon << QPointF( 0, rect().height() );
197 shapePolygon << QPointF( rect().width() , rect().height() );
198 shapePolygon << QPointF( rect().width() / 2.0, 0 );
199 shapePolygon << QPointF( 0, rect().height() );
211 setPen( QPen( QBrush( Qt::NoBrush ), maxBleed * 2.0 ) );
235 p->setBrush( Qt::NoBrush );
236 p->setRenderHint( QPainter::Antialiasing,
true );
245 p->setBrush( brush() );
246 p->setPen( Qt::NoPen );
247 p->setRenderHint( QPainter::Antialiasing,
true );
259 QDomElement composerShapeElem = doc.createElement(
"ComposerShape" );
260 composerShapeElem.setAttribute(
"shapeType",
mShape );
261 composerShapeElem.setAttribute(
"cornerRadius",
mCornerRadius );
264 composerShapeElem.appendChild( shapeStyleElem );
266 elem.appendChild( composerShapeElem );
267 return _writeXML( composerShapeElem, doc );
273 mCornerRadius = itemElem.attribute(
"cornerRadius",
"0" ).toDouble();
276 QDomNodeList composerItemList = itemElem.elementsByTagName(
"ComposerItem" );
277 if ( composerItemList.size() > 0 )
279 QDomElement composerItemElem = composerItemList.at( 0 ).toElement();
282 if ( composerItemElem.attribute(
"rotation",
"0" ).toDouble() != 0 )
285 setItemRotation( composerItemElem.attribute(
"rotation",
"0" ).toDouble() );
291 QDomElement shapeStyleSymbolElem = itemElem.firstChildElement(
"symbol" );
292 if ( !shapeStyleSymbolElem.isNull() )
305 properties.insert(
"style",
"solid" );
309 properties.insert(
"style",
"no" );
313 properties.insert(
"style_border",
"solid" );
317 properties.insert(
"style_border",
"no" );
320 properties.insert(
"width_border", QString::number( pen().widthF() ) );