void createPenNode( QDomDocument& doc, QDomNode& parent, const QString& elementName, const QPen& pen ) { QDomElement penElement = doc.createElement( elementName ); parent.appendChild( penElement ); createIntNode( doc, penElement, "Width", pen.width() ); createColorNode( doc, penElement, "Color", pen.color() ); createStringNode( doc, penElement, "Style", penStyleToString( pen.style() ) ); }
void createBrushNode( QDomDocument& doc, QDomNode& parent, const QString& elementName, const QBrush& brush ) { QDomElement brushElement = doc.createElement( elementName ); parent.appendChild( brushElement ); createColorNode( doc, brushElement, "Color", brush.color() ); createStringNode( doc, brushElement, "Style", KDGanttXML::brushStyleToString( brush.style() ) ); if( brush.style() == Qt::CustomPattern && brush.pixmap() ) createPixmapNode( doc, brushElement, "Pixmap", *brush.pixmap() ); }
sp<RenderNode> createCard(int x, int y, int width, int height, bool selected) { return TestUtils::createNode(x, y, x + width, y + height, [width, height, selected, this]( RenderProperties& props, Canvas& canvas) { if (selected) { props.setElevation(dp(16)); props.setScaleX(1.2); props.setScaleY(1.2); } props.mutableOutline().setRoundRect(0, 0, width, height, roundedCornerRadius(), 1); props.mutableOutline().setShouldClip(true); sk_sp<Bitmap> bitmap = useSingleBitmap() ? mSingleBitmap : mAllocator(width, dp(120), kRGBA_8888_SkColorType, [this](SkBitmap& skBitmap) { skBitmap.eraseColor(0xFF000000 | ((mSeed << 3) & 0xFF)); }); sp<RenderNode> cardImage = createSharedBitmapNode(canvas, 0, 0, width, dp(120), bitmap); canvas.drawRenderNode(cardImage.get()); mCachedBitmaps.push_back(bitmap); mImages.push_back(cardImage); char buffer[128]; sprintf(buffer, "Video %d-%d", mSeed, mSeed + 1); mSeed++; char buffer2[128]; sprintf(buffer2, "Studio %d", mSeed2++); sp<RenderNode> infoArea = createInfoNode(canvas, 0, dp(120), width, height, buffer, buffer2); canvas.drawRenderNode(infoArea.get()); mInfoAreas.push_back(infoArea); if (useOverlay()) { sp<RenderNode> overlayColor = createColorNode(canvas, 0, 0, width, height, 0x00000000); canvas.drawRenderNode(overlayColor.get()); mOverlays.push_back(overlayColor); } }); }