summaryrefslogtreecommitdiffstats
path: root/examples/declarative/dial
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-10-30 05:33:39 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-10-30 05:33:39 (GMT)
commitfe2d8f1e7560c441694ef3650ba41c3a5298a44f (patch)
treec9554e6bdbb6504d2edb05bae7d955ba1bbf4209 /examples/declarative/dial
parentabf60e8e075ecbf2c14e84d40fecff973dd124c7 (diff)
downloadQt-fe2d8f1e7560c441694ef3650ba41c3a5298a44f.zip
Qt-fe2d8f1e7560c441694ef3650ba41c3a5298a44f.tar.gz
Qt-fe2d8f1e7560c441694ef3650ba41c3a5298a44f.tar.bz2
cleanup dial example
Diffstat (limited to 'examples/declarative/dial')
-rw-r--r--examples/declarative/dial/content/Dial.qml (renamed from examples/declarative/dial/DialLibrary/Dial.qml)2
-rw-r--r--examples/declarative/dial/content/background.png (renamed from examples/declarative/dial/DialLibrary/background.png)bin35876 -> 35876 bytes
-rw-r--r--examples/declarative/dial/content/needle.png (renamed from examples/declarative/dial/DialLibrary/needle.png)bin342 -> 342 bytes
-rw-r--r--examples/declarative/dial/content/needle_shadow.png (renamed from examples/declarative/dial/DialLibrary/needle_shadow.png)bin632 -> 632 bytes
-rw-r--r--examples/declarative/dial/content/overlay.png (renamed from examples/declarative/dial/DialLibrary/overlay.png)bin3564 -> 3564 bytes
-rw-r--r--examples/declarative/dial/dial.pro9
-rw-r--r--examples/declarative/dial/dial.qml26
-rw-r--r--examples/declarative/dial/dial.qrc10
-rw-r--r--examples/declarative/dial/main.cpp18
9 files changed, 15 insertions, 50 deletions
diff --git a/examples/declarative/dial/DialLibrary/Dial.qml b/examples/declarative/dial/content/Dial.qml
index c1e9770..6fd0f39 100644
--- a/examples/declarative/dial/DialLibrary/Dial.qml
+++ b/examples/declarative/dial/content/Dial.qml
@@ -29,7 +29,7 @@ Item {
angle: SpringFollow {
spring: 1.4
damping: .15
- source: Math.min(Math.max(-130, root.value*2.2 - 130), 133)
+ source: Math.min(Math.max(-130, root.value*2.6 - 130), 133)
}
}
}
diff --git a/examples/declarative/dial/DialLibrary/background.png b/examples/declarative/dial/content/background.png
index 75d555d..75d555d 100644
--- a/examples/declarative/dial/DialLibrary/background.png
+++ b/examples/declarative/dial/content/background.png
Binary files differ
diff --git a/examples/declarative/dial/DialLibrary/needle.png b/examples/declarative/dial/content/needle.png
index 2d19f75..2d19f75 100644
--- a/examples/declarative/dial/DialLibrary/needle.png
+++ b/examples/declarative/dial/content/needle.png
Binary files differ
diff --git a/examples/declarative/dial/DialLibrary/needle_shadow.png b/examples/declarative/dial/content/needle_shadow.png
index 8d8a928..8d8a928 100644
--- a/examples/declarative/dial/DialLibrary/needle_shadow.png
+++ b/examples/declarative/dial/content/needle_shadow.png
Binary files differ
diff --git a/examples/declarative/dial/DialLibrary/overlay.png b/examples/declarative/dial/content/overlay.png
index 3860a7b..3860a7b 100644
--- a/examples/declarative/dial/DialLibrary/overlay.png
+++ b/examples/declarative/dial/content/overlay.png
Binary files 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 @@
-<RCC>
- <qresource prefix="/">
- <file>DialLibrary/background.png</file>
- <file>DialLibrary/overlay.png</file>
- <file>DialLibrary/needle_shadow.png</file>
- <file>DialLibrary/needle.png</file>
- <file>DialLibrary/Dial.qml</file>
- <file>dial.qml</file>
- </qresource>
-</RCC>
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 <QApplication>
-#include <QUrl>
-#include <qmlview.h>
-
-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();
-}
-
-