summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/svg/embedded/fluidlauncher/backup_registration.xml8
-rw-r--r--examples/svg/embeddedsvgviewer/shapes.svg86
-rw-r--r--examples/svg/embeddedsvgviewer/spheres.svg81
-rw-r--r--examples/svg/richtext/textobject/textobject.desktop11
-rw-r--r--examples/svg/svggenerator/svggenerator.desktop11
-rw-r--r--examples/svg/svgviewer/svgviewer.desktop11
-rw-r--r--src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp9
-rw-r--r--src/svg/doc/qtsvg.qdocconf8
-rw-r--r--src/svg/qsvggenerator.cpp1
9 files changed, 13 insertions, 213 deletions
diff --git a/examples/svg/embedded/fluidlauncher/backup_registration.xml b/examples/svg/embedded/fluidlauncher/backup_registration.xml
deleted file mode 100644
index 794e11d..0000000
--- a/examples/svg/embedded/fluidlauncher/backup_registration.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<backup_registration>
- <passive_backup>
- <include_directory name = "\" />
- </passive_backup>
- <system_backup/>
- <restore requires_reboot = "no"/>
-</backup_registration>
diff --git a/examples/svg/embeddedsvgviewer/shapes.svg b/examples/svg/embeddedsvgviewer/shapes.svg
deleted file mode 100644
index c28a711..0000000
--- a/examples/svg/embeddedsvgviewer/shapes.svg
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="400px"
- height="400px"
- baseProfile="tiny"
- id="svg8268"
- sodipodi:version="0.32"
- inkscape:version="0.45.1"
- sodipodi:docname="simple2.svg"
- sodipodi:docbase="/nfs/OpenMoko/SVGs"
- inkscape:output_extension="org.inkscape.output.svg.inkscape">
- <metadata
- id="metadata8283">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs8281" />
- <sodipodi:namedview
- inkscape:window-height="917"
- inkscape:window-width="1324"
- inkscape:pageshadow="2"
- inkscape:pageopacity="0.0"
- guidetolerance="10.0"
- gridtolerance="10.0"
- objecttolerance="10.0"
- borderopacity="1.0"
- bordercolor="#666666"
- pagecolor="#ffffff"
- id="base"
- inkscape:zoom="2.1452345"
- inkscape:cx="185.25"
- inkscape:cy="214.75"
- inkscape:window-x="0"
- inkscape:window-y="30"
- inkscape:current-layer="svg8268" />
- <g
- stroke="DarkBlue"
- stroke-width="10"
- id="g8270">
- <rect
- fill="blue"
- fill-opacity="0.5"
- x="25"
- y="25"
- width="175"
- height="175"
- id="rect8272" />
- </g>
- <circle
- cx="200"
- cy="200"
- r="75"
- id="circle8274"
- sodipodi:cx="200"
- sodipodi:cy="200"
- sodipodi:rx="75"
- sodipodi:ry="75"
- transform="translate(-26.104372,21.909027)"
- style="fill:#ffff00;fill-opacity:0.5;stroke:#000000" />
- <polygon
- fill="green"
- stroke="black"
- fill-opacity="0.5"
- stroke-width="1"
- points="200,225 350,225 275,350"
- id="polygon8276" />
- <path
- style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:0.50196081"
- d="M 303.7037,50.705207 C 173.88522,56.588264 90.320951,92.710345 162.85059,120.82533 C 211.91719,139.84524 196.63811,214.12391 233.86243,192.59259 C 284.31755,163.4083 299.34345,193.75691 311.11111,187.30159 C 347.88407,167.12924 269.34382,134.85785 303.81608,114.5167 C 394.71183,60.881583 332.47907,46.043712 303.7037,50.705207 z "
- id="path8289"
- sodipodi:nodetypes="cssssc" />
-</svg>
diff --git a/examples/svg/embeddedsvgviewer/spheres.svg b/examples/svg/embeddedsvgviewer/spheres.svg
deleted file mode 100644
index e108777..0000000
--- a/examples/svg/embeddedsvgviewer/spheres.svg
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<svg width="8cm" height="8cm" viewBox="0 0 400 400"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink/"
- baseProfile="tiny" version="1.2">
- <title>Spheres</title>
- <desc>Gradient filled spheres with different colors.</desc>
- <defs>
- <!-- Create radial gradients for each circle to make them look like
- spheres. -->
- <radialGradient id="blueSphere" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" />
- <stop offset="75%" stop-color="blue" />
- <stop offset="100%" stop-color="#222244" />
- </radialGradient>
- <radialGradient id="redSphere" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" />
- <stop offset="75%" stop-color="red" />
- <stop offset="100%" stop-color="#442222" />
- </radialGradient>
- <radialGradient id="greenSphere" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" />
- <stop offset="75%" stop-color="green" />
- <stop offset="100%" stop-color="#113311" />
- </radialGradient>
- <radialGradient id="yellowSphere" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="-50">
- <stop offset="0%" stop-color="white" />
- <stop offset="75%" stop-color="yellow" />
- <stop offset="100%" stop-color="#444422" />
- </radialGradient>
- <radialGradient id="shadowGrad" gradientUnits="userSpaceOnUse"
- cx="0" cy="0" r="100" fx="-50" fy="50">
- <stop offset="0%" stop-color="black" stop-opacity="1.0" />
- <stop offset="100%" stop-color="white" stop-opacity="0.0" />
- </radialGradient>
-
- <!-- Define a shadow for each sphere. -->
- <circle id="shadow" fill="url(#shadowGrad)" cx="0" cy="0" r="100" />
- </defs>
- <g fill="#ffee99" stroke="none" >
- <rect x="0" y="0" width="400" height="400" />
- </g>
- <g fill="white" stroke="none" >
- <rect x="0" y="175" width="400" height="225" />
- </g>
- <g transform="translate(200,290) scale(2.0,1.0) rotate(45)" >
- <rect fill="#a6ce39" x="-69" y="-69" width="138" height="138" />
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <animateTransform attributeName="transform" type="rotate" values="0; 360"
- begin="0s" dur="10s" fill="freeze" />
- </g>
- <g transform="translate(200,175)">
- <use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
- <circle fill="url(#blueSphere)" cx="0" cy="0" r="100" />
- </g>
- <g transform="translate(315,240)">
- <g transform="scale(0.5,0.5)">
- <use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
- <circle fill="url(#redSphere)" cx="0" cy="0" r="100" />
- </g>
- </g>
- <g transform="translate(80,275)">
- <g transform="scale(0.65,0.65)">
- <use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
- <circle fill="url(#greenSphere)" cx="0" cy="0" r="100" />
- </g>
- </g>
- <g transform="translate(255,325)">
- <g transform="scale(0.3,0.3)">
- <use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
- <circle fill="url(#yellowSphere)" cx="0" cy="0" r="100" />
- </g>
- </g>
-</svg>
diff --git a/examples/svg/richtext/textobject/textobject.desktop b/examples/svg/richtext/textobject/textobject.desktop
deleted file mode 100644
index 1b0980f..0000000
--- a/examples/svg/richtext/textobject/textobject.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=Text Object
-Exec=/opt/usr/bin/textobject
-Icon=textobject
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
diff --git a/examples/svg/svggenerator/svggenerator.desktop b/examples/svg/svggenerator/svggenerator.desktop
deleted file mode 100644
index 3ae32a4..0000000
--- a/examples/svg/svggenerator/svggenerator.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=SVG Generator
-Exec=/opt/usr/bin/svggenerator
-Icon=svggenerator
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
diff --git a/examples/svg/svgviewer/svgviewer.desktop b/examples/svg/svgviewer/svgviewer.desktop
deleted file mode 100644
index 477ef78..0000000
--- a/examples/svg/svgviewer/svgviewer.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=SVG Viewer
-Exec=/opt/usr/bin/svgviewer
-Icon=svgviewer
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
diff --git a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
index 4fd4c3a..713f2ad 100644
--- a/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
+++ b/src/plugins/iconengines/svgiconengine/qsvgiconengine.cpp
@@ -122,10 +122,13 @@ QSize QSvgIconEngine::actualSize(const QSize &size, QIcon::Mode mode,
void QSvgIconEnginePrivate::loadDataForModeAndState(QSvgRenderer *renderer, QIcon::Mode mode, QIcon::State state)
{
QByteArray buf;
+ const QIcon::State oppositeState = state == QIcon::Off ? QIcon::On : QIcon::Off;
if (svgBuffers) {
buf = svgBuffers->value(hashKey(mode, state));
if (buf.isEmpty())
- buf = svgBuffers->value(hashKey(QIcon::Normal, QIcon::Off));
+ buf = svgBuffers->value(hashKey(QIcon::Normal, state));
+ if (buf.isEmpty())
+ buf = svgBuffers->value(hashKey(QIcon::Normal, oppositeState));
}
if (!buf.isEmpty()) {
#ifndef QT_NO_COMPRESS
@@ -135,7 +138,9 @@ void QSvgIconEnginePrivate::loadDataForModeAndState(QSvgRenderer *renderer, QIco
} else {
QString svgFile = svgFiles.value(hashKey(mode, state));
if (svgFile.isEmpty())
- svgFile = svgFiles.value(hashKey(QIcon::Normal, QIcon::Off));
+ svgFile = svgFiles.value(hashKey(QIcon::Normal, state));
+ if (svgFile.isEmpty())
+ svgFile = svgFiles.value(hashKey(QIcon::Normal, oppositeState));
if (!svgFile.isEmpty())
renderer->load(svgFile);
}
diff --git a/src/svg/doc/qtsvg.qdocconf b/src/svg/doc/qtsvg.qdocconf
index e8460e9..b180daa 100644
--- a/src/svg/doc/qtsvg.qdocconf
+++ b/src/svg/doc/qtsvg.qdocconf
@@ -31,15 +31,17 @@ depends += qtcore \
tagfile = ../../../doc/qtsvg/qtsvg.tags
headerdirs += .. \
- ../../plugins/svg
+ ../../plugins/imageformats \
+ ../../plugins/iconengines
sourcedirs += .. \
- ../../plugins/svg
+ ../../plugins/imageformats \
+ ../../plugins/iconengines
exampledirs += ../../../examples/svg \
snippets/
-examplesinstallpath = qtsvg/svg
+examplesinstallpath = svg
imagedirs += images
diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp
index 468b97f..0abd403 100644
--- a/src/svg/qsvggenerator.cpp
+++ b/src/svg/qsvggenerator.cpp
@@ -798,6 +798,7 @@ int QSvgGenerator::metric(QPaintDevice::PaintDeviceMetric metric) const
case QPaintDevice::PdmPhysicalDpiY:
return d->engine->resolution();
case QPaintDevice::PdmDevicePixelRatio:
+ case QPaintDevice::PdmDevicePixelRatioScaled:
return 1;
default:
qWarning("QSvgGenerator::metric(), unhandled metric %d\n", metric);