20 #include <QDomDocument>
21 #include <QDomElement>
36 QDomElement documentElem = doc.documentElement();
37 if ( documentElem.isNull() )
42 QDomElement svgAnnotationElem = doc.createElement(
"SVGAnnotationItem" );
45 documentElem.appendChild( svgAnnotationElem );
52 QDomElement annotationElem = itemElem.firstChildElement(
"AnnotationItem" );
53 if ( !annotationElem.isNull() )
73 QRect viewBox = mSvgRenderer.viewBox();
74 if ( viewBox.isValid() )
76 double widthRatio =
mFrameSize.width() / viewBox.width();
77 double heightRatio =
mFrameSize.height() / viewBox.height();
78 double renderWidth = 0;
79 double renderHeight = 0;
80 if ( widthRatio <= heightRatio )
83 renderHeight = viewBox.height() *
mFrameSize.width() / viewBox.width();
88 renderWidth = viewBox.width() *
mFrameSize.height() / viewBox.height();
103 mSvgRenderer.load( mFilePath );