From fe2d8f1e7560c441694ef3650ba41c3a5298a44f Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 30 Oct 2009 15:33:39 +1000 Subject: cleanup dial example --- examples/declarative/dial/DialLibrary/Dial.qml | 37 --------------------- .../declarative/dial/DialLibrary/background.png | Bin 35876 -> 0 bytes examples/declarative/dial/DialLibrary/needle.png | Bin 342 -> 0 bytes .../declarative/dial/DialLibrary/needle_shadow.png | Bin 632 -> 0 bytes examples/declarative/dial/DialLibrary/overlay.png | Bin 3564 -> 0 bytes examples/declarative/dial/content/Dial.qml | 37 +++++++++++++++++++++ examples/declarative/dial/content/background.png | Bin 0 -> 35876 bytes examples/declarative/dial/content/needle.png | Bin 0 -> 342 bytes .../declarative/dial/content/needle_shadow.png | Bin 0 -> 632 bytes examples/declarative/dial/content/overlay.png | Bin 0 -> 3564 bytes examples/declarative/dial/dial.pro | 9 ----- examples/declarative/dial/dial.qml | 26 ++++++++------- examples/declarative/dial/dial.qrc | 10 ------ examples/declarative/dial/main.cpp | 18 ---------- 14 files changed, 51 insertions(+), 86 deletions(-) delete mode 100644 examples/declarative/dial/DialLibrary/Dial.qml delete mode 100644 examples/declarative/dial/DialLibrary/background.png delete mode 100644 examples/declarative/dial/DialLibrary/needle.png delete mode 100644 examples/declarative/dial/DialLibrary/needle_shadow.png delete mode 100644 examples/declarative/dial/DialLibrary/overlay.png create mode 100644 examples/declarative/dial/content/Dial.qml create mode 100644 examples/declarative/dial/content/background.png create mode 100644 examples/declarative/dial/content/needle.png create mode 100644 examples/declarative/dial/content/needle_shadow.png create mode 100644 examples/declarative/dial/content/overlay.png delete mode 100644 examples/declarative/dial/dial.pro delete mode 100644 examples/declarative/dial/dial.qrc delete mode 100644 examples/declarative/dial/main.cpp diff --git a/examples/declarative/dial/DialLibrary/Dial.qml b/examples/declarative/dial/DialLibrary/Dial.qml deleted file mode 100644 index c1e9770..0000000 --- a/examples/declarative/dial/DialLibrary/Dial.qml +++ /dev/null @@ -1,37 +0,0 @@ -import Qt 4.6 - -Item { - id: root - property real value : 0 - - width: 210; height: 210 - - Image { source: "background.png" } - - Image { - x: 93 - y: 35 - source: "needle_shadow.png" - transform: Rotation { - origin.x: 11; origin.y: 67 - angle: needleRotation.angle - } - } - Image { - id: needle - x: 95; y: 33 - smooth: true - source: "needle.png" - transform: Rotation { - id: needleRotation - origin.x: 7; origin.y: 65 - angle: -130 - angle: SpringFollow { - spring: 1.4 - damping: .15 - source: Math.min(Math.max(-130, root.value*2.2 - 130), 133) - } - } - } - Image { x: 21; y: 18; source: "overlay.png" } -} diff --git a/examples/declarative/dial/DialLibrary/background.png b/examples/declarative/dial/DialLibrary/background.png deleted file mode 100644 index 75d555d..0000000 Binary files a/examples/declarative/dial/DialLibrary/background.png and /dev/null differ diff --git a/examples/declarative/dial/DialLibrary/needle.png b/examples/declarative/dial/DialLibrary/needle.png deleted file mode 100644 index 2d19f75..0000000 Binary files a/examples/declarative/dial/DialLibrary/needle.png and /dev/null differ diff --git a/examples/declarative/dial/DialLibrary/needle_shadow.png b/examples/declarative/dial/DialLibrary/needle_shadow.png deleted file mode 100644 index 8d8a928..0000000 Binary files a/examples/declarative/dial/DialLibrary/needle_shadow.png and /dev/null differ diff --git a/examples/declarative/dial/DialLibrary/overlay.png b/examples/declarative/dial/DialLibrary/overlay.png deleted file mode 100644 index 3860a7b..0000000 Binary files a/examples/declarative/dial/DialLibrary/overlay.png and /dev/null differ diff --git a/examples/declarative/dial/content/Dial.qml b/examples/declarative/dial/content/Dial.qml new file mode 100644 index 0000000..6fd0f39 --- /dev/null +++ b/examples/declarative/dial/content/Dial.qml @@ -0,0 +1,37 @@ +import Qt 4.6 + +Item { + id: root + property real value : 0 + + width: 210; height: 210 + + Image { source: "background.png" } + + Image { + x: 93 + y: 35 + source: "needle_shadow.png" + transform: Rotation { + origin.x: 11; origin.y: 67 + angle: needleRotation.angle + } + } + Image { + id: needle + x: 95; y: 33 + smooth: true + source: "needle.png" + transform: Rotation { + id: needleRotation + origin.x: 7; origin.y: 65 + angle: -130 + angle: SpringFollow { + spring: 1.4 + damping: .15 + source: Math.min(Math.max(-130, root.value*2.6 - 130), 133) + } + } + } + Image { x: 21; y: 18; source: "overlay.png" } +} diff --git a/examples/declarative/dial/content/background.png b/examples/declarative/dial/content/background.png new file mode 100644 index 0000000..75d555d Binary files /dev/null and b/examples/declarative/dial/content/background.png differ diff --git a/examples/declarative/dial/content/needle.png b/examples/declarative/dial/content/needle.png new file mode 100644 index 0000000..2d19f75 Binary files /dev/null and b/examples/declarative/dial/content/needle.png differ diff --git a/examples/declarative/dial/content/needle_shadow.png b/examples/declarative/dial/content/needle_shadow.png new file mode 100644 index 0000000..8d8a928 Binary files /dev/null and b/examples/declarative/dial/content/needle_shadow.png differ diff --git a/examples/declarative/dial/content/overlay.png b/examples/declarative/dial/content/overlay.png new file mode 100644 index 0000000..3860a7b Binary files /dev/null and b/examples/declarative/dial/content/overlay.png differ diff --git a/examples/declarative/dial/dial.pro b/examples/declarative/dial/dial.pro deleted file mode 100644 index 1d1f811..0000000 --- a/examples/declarative/dial/dial.pro +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES = main.cpp -RESOURCES = dial.qrc - -QT += script declarative - -target.path = $$[QT_INSTALL_EXAMPLES]/declarative/dial -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dial.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/dial -INSTALLS += target sources diff --git a/examples/declarative/dial/dial.qml b/examples/declarative/dial/dial.qml index c7baf25..c7b7659 100644 --- a/examples/declarative/dial/dial.qml +++ b/examples/declarative/dial/dial.qml @@ -1,32 +1,34 @@ import Qt 4.6 +import "content" -import "DialLibrary" Rectangle { - color: "white" - width: 210; height: 240 + color: "#545454" + width: 300; height: 300 // Dial with a slider to adjust it - Dial { id: dial; value: slider.x-2 } + Dial { id: dial; anchors.centerIn: parent; value: slider.x *100 / (container.width - 34) } Rectangle { - anchors.top: dial.bottom - x: 20; width: 160; height: 16 + id: container + anchors.bottom: parent.bottom; anchors.bottomMargin: 10 + anchors.left: parent.left; anchors.leftMargin: 20 + anchors.right: parent.right; anchors.rightMargin: 20; height: 16 gradient: Gradient { - GradientStop { position: 0.0; color: "steelblue" } - GradientStop { position: 1.0; color: "lightsteelblue" } + GradientStop { position: 0.0; color: "gray" } + GradientStop { position: 1.0; color: "white" } } radius: 8; opacity: 0.7; smooth: true Rectangle { id: slider - x: 2; y: 2; width: 30; height: 12 + x: 1; y: 1; width: 30; height: 14 radius: 6; smooth: true gradient: Gradient { - GradientStop { position: 0.0; color: "lightgray" } - GradientStop { position: 1.0; color: "gray" } + GradientStop { position: 0.0; color: "#424242" } + GradientStop { position: 1.0; color: "black" } } MouseRegion { anchors.fill: parent - drag.target: parent; drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: 128 + drag.target: parent; drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: container.width - 32 } } } diff --git a/examples/declarative/dial/dial.qrc b/examples/declarative/dial/dial.qrc deleted file mode 100644 index 77354c0..0000000 --- a/examples/declarative/dial/dial.qrc +++ /dev/null @@ -1,10 +0,0 @@ - - - DialLibrary/background.png - DialLibrary/overlay.png - DialLibrary/needle_shadow.png - DialLibrary/needle.png - DialLibrary/Dial.qml - dial.qml - - diff --git a/examples/declarative/dial/main.cpp b/examples/declarative/dial/main.cpp deleted file mode 100644 index b65c9ff..0000000 --- a/examples/declarative/dial/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QmlView *canvas = new QmlView; - canvas->setUrl(QUrl("qrc:/dial.qml")); - canvas->execute(); - canvas->resize(210,240); - canvas->show(); - - return app.exec(); -} - - -- cgit v0.12