From dc5a426dba72eb1193f6cce913ece94d369d0fbe Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 20 May 2010 15:03:40 +0200 Subject: Some minor example fixes -dial moved to dial-example so the dirname is the same as the qml name -added rssnews to .pro so it can be installed -added some README files like the other dirs --- demos/declarative/declarative.pro | 2 + examples/declarative/README | 41 +++++++++++++++++ examples/declarative/toys/README | 37 +++++++++++++++ .../declarative/toys/dial-example/content/Dial.qml | 43 ++++++++++++++++++ .../toys/dial-example/content/background.png | Bin 0 -> 35876 bytes .../toys/dial-example/content/needle.png | Bin 0 -> 342 bytes .../toys/dial-example/content/needle_shadow.png | Bin 0 -> 632 bytes .../toys/dial-example/content/overlay.png | Bin 0 -> 3564 bytes .../declarative/toys/dial-example/dial-example.qml | 50 +++++++++++++++++++++ .../declarative/toys/dial-example/dial.qmlproject | 16 +++++++ examples/declarative/toys/dial/content/Dial.qml | 43 ------------------ .../declarative/toys/dial/content/background.png | Bin 35876 -> 0 bytes examples/declarative/toys/dial/content/needle.png | Bin 342 -> 0 bytes .../toys/dial/content/needle_shadow.png | Bin 632 -> 0 bytes examples/declarative/toys/dial/content/overlay.png | Bin 3564 -> 0 bytes examples/declarative/toys/dial/dial-example.qml | 50 --------------------- examples/declarative/toys/dial/dial.qmlproject | 16 ------- 17 files changed, 189 insertions(+), 109 deletions(-) create mode 100644 examples/declarative/README create mode 100644 examples/declarative/toys/README create mode 100644 examples/declarative/toys/dial-example/content/Dial.qml create mode 100644 examples/declarative/toys/dial-example/content/background.png create mode 100644 examples/declarative/toys/dial-example/content/needle.png create mode 100644 examples/declarative/toys/dial-example/content/needle_shadow.png create mode 100644 examples/declarative/toys/dial-example/content/overlay.png create mode 100644 examples/declarative/toys/dial-example/dial-example.qml create mode 100644 examples/declarative/toys/dial-example/dial.qmlproject delete mode 100644 examples/declarative/toys/dial/content/Dial.qml delete mode 100644 examples/declarative/toys/dial/content/background.png delete mode 100644 examples/declarative/toys/dial/content/needle.png delete mode 100644 examples/declarative/toys/dial/content/needle_shadow.png delete mode 100644 examples/declarative/toys/dial/content/overlay.png delete mode 100644 examples/declarative/toys/dial/dial-example.qml delete mode 100644 examples/declarative/toys/dial/dial.qmlproject diff --git a/demos/declarative/declarative.pro b/demos/declarative/declarative.pro index aa60db0..2963386 100644 --- a/demos/declarative/declarative.pro +++ b/demos/declarative/declarative.pro @@ -12,7 +12,9 @@ sources.files = \ samegame \ snake \ twitter \ + rssnews \ webbrowser + sources.path = $$[QT_INSTALL_DEMOS]/declarative INSTALLS += sources diff --git a/examples/declarative/README b/examples/declarative/README new file mode 100644 index 0000000..9e0f4c4 --- /dev/null +++ b/examples/declarative/README @@ -0,0 +1,41 @@ +The Qt Declarative module provides the ability to specify and implement +your UI declaratively, using the Qt Meta-Object Language(QML). This +language is very expressive and human readable, and can be used by +designers to actually implement their UI vision. QML UIs can integrate +with C++ code in many ways, including being loaded as a part of a C++ UI +and loading data models from C++ and interacting with them. + +The example launcher provided with Qt can be used to explore each of the +examples in this directory. But most can also be viewed directly with the +QML viewer utility, without requiring compilation. + +Documentation for these examples can be found via the Tutorial and Examples +link in the main Qt documentation. + + +Finding the Qt Examples and Demos launcher +========================================== + +On Windows: + +The launcher can be accessed via the Windows Start menu. Select the menu +entry entitled "Qt Examples and Demos" entry in the submenu containing +the Qt tools. + +On Mac OS X: + +For the binary distribution, the qtdemo executable is installed in the +/Developer/Applications/Qt directory. For the source distribution, it is +installed alongside the other Qt tools on the path specified when Qt is +configured. + +On Unix/Linux: + +The qtdemo executable is installed alongside the other Qt tools on the path +specified when Qt is configured. + +On all platforms: + +The source code for the launcher can be found in the demos/qtdemo directory +in the Qt package. This example is built at the same time as the Qt libraries, +tools, examples, and demonstrations. diff --git a/examples/declarative/toys/README b/examples/declarative/toys/README new file mode 100644 index 0000000..7fd7eb0 --- /dev/null +++ b/examples/declarative/toys/README @@ -0,0 +1,37 @@ +These pure QML examples create complete components to demonstrate +some of what can be easily done using just a few QML files. + +The example launcher provided with Qt can be used to explore each of the +examples in this directory. They can also be viewed directly with the +QML viewer utility, without requiring compilation. + +Documentation for these examples can be found via the Tutorial and Examples +link in the main Qt documentation. + + +Finding the Qt Examples and Demos launcher +========================================== + +On Windows: + +The launcher can be accessed via the Windows Start menu. Select the menu +entry entitled "Qt Examples and Demos" entry in the submenu containing +the Qt tools. + +On Mac OS X: + +For the binary distribution, the qtdemo executable is installed in the +/Developer/Applications/Qt directory. For the source distribution, it is +installed alongside the other Qt tools on the path specified when Qt is +configured. + +On Unix/Linux: + +The qtdemo executable is installed alongside the other Qt tools on the path +specified when Qt is configured. + +On all platforms: + +The source code for the launcher can be found in the demos/qtdemo directory +in the Qt package. This example is built at the same time as the Qt libraries, +tools, examples, and demonstrations. diff --git a/examples/declarative/toys/dial-example/content/Dial.qml b/examples/declarative/toys/dial-example/content/Dial.qml new file mode 100644 index 0000000..6f24801 --- /dev/null +++ b/examples/declarative/toys/dial-example/content/Dial.qml @@ -0,0 +1,43 @@ +import Qt 4.7 + +Item { + id: root + property real value : 0 + + width: 210; height: 210 + + Image { source: "background.png" } + +//! [needle_shadow] + Image { + x: 93 + y: 35 + source: "needle_shadow.png" + transform: Rotation { + origin.x: 11; origin.y: 67 + angle: needleRotation.angle + } + } +//! [needle_shadow] +//! [needle] + Image { + id: needle + x: 95; y: 33 + smooth: true + source: "needle.png" + transform: Rotation { + id: needleRotation + origin.x: 7; origin.y: 65 + angle: -130 + SpringFollow on angle { + spring: 1.4 + damping: .15 + to: Math.min(Math.max(-130, root.value*2.6 - 130), 133) + } + } + } +//! [needle] +//! [overlay] + Image { x: 21; y: 18; source: "overlay.png" } +//! [overlay] +} diff --git a/examples/declarative/toys/dial-example/content/background.png b/examples/declarative/toys/dial-example/content/background.png new file mode 100644 index 0000000..75d555d Binary files /dev/null and b/examples/declarative/toys/dial-example/content/background.png differ diff --git a/examples/declarative/toys/dial-example/content/needle.png b/examples/declarative/toys/dial-example/content/needle.png new file mode 100644 index 0000000..2d19f75 Binary files /dev/null and b/examples/declarative/toys/dial-example/content/needle.png differ diff --git a/examples/declarative/toys/dial-example/content/needle_shadow.png b/examples/declarative/toys/dial-example/content/needle_shadow.png new file mode 100644 index 0000000..8d8a928 Binary files /dev/null and b/examples/declarative/toys/dial-example/content/needle_shadow.png differ diff --git a/examples/declarative/toys/dial-example/content/overlay.png b/examples/declarative/toys/dial-example/content/overlay.png new file mode 100644 index 0000000..3860a7b Binary files /dev/null and b/examples/declarative/toys/dial-example/content/overlay.png differ diff --git a/examples/declarative/toys/dial-example/dial-example.qml b/examples/declarative/toys/dial-example/dial-example.qml new file mode 100644 index 0000000..900954f --- /dev/null +++ b/examples/declarative/toys/dial-example/dial-example.qml @@ -0,0 +1,50 @@ +import Qt 4.7 +import "content" + +//! [0] +Rectangle { + color: "#545454" + width: 300; height: 300 + + // Dial with a slider to adjust it + Dial { + id: dial + anchors.centerIn: parent + value: slider.x * 100 / (container.width - 34) + } + + Rectangle { + id: container + anchors { bottom: parent.bottom; left: parent.left + right: parent.right; leftMargin: 20; rightMargin: 20 + bottomMargin: 10 + } + height: 16 + + radius: 8 + opacity: 0.7 + smooth: true + gradient: Gradient { + GradientStop { position: 0.0; color: "gray" } + GradientStop { position: 1.0; color: "white" } + } + + Rectangle { + id: slider + x: 1; y: 1; width: 30; height: 14 + radius: 6 + smooth: true + gradient: Gradient { + GradientStop { position: 0.0; color: "#424242" } + GradientStop { position: 1.0; color: "black" } + } + + MouseArea { + anchors.fill: parent + drag.target: parent; drag.axis: Drag.XAxis + drag.minimumX: 2; drag.maximumX: container.width - 32 + } + } + } +} +//! [0] \ No newline at end of file diff --git a/examples/declarative/toys/dial-example/dial.qmlproject b/examples/declarative/toys/dial-example/dial.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/toys/dial-example/dial.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/toys/dial/content/Dial.qml b/examples/declarative/toys/dial/content/Dial.qml deleted file mode 100644 index 6f24801..0000000 --- a/examples/declarative/toys/dial/content/Dial.qml +++ /dev/null @@ -1,43 +0,0 @@ -import Qt 4.7 - -Item { - id: root - property real value : 0 - - width: 210; height: 210 - - Image { source: "background.png" } - -//! [needle_shadow] - Image { - x: 93 - y: 35 - source: "needle_shadow.png" - transform: Rotation { - origin.x: 11; origin.y: 67 - angle: needleRotation.angle - } - } -//! [needle_shadow] -//! [needle] - Image { - id: needle - x: 95; y: 33 - smooth: true - source: "needle.png" - transform: Rotation { - id: needleRotation - origin.x: 7; origin.y: 65 - angle: -130 - SpringFollow on angle { - spring: 1.4 - damping: .15 - to: Math.min(Math.max(-130, root.value*2.6 - 130), 133) - } - } - } -//! [needle] -//! [overlay] - Image { x: 21; y: 18; source: "overlay.png" } -//! [overlay] -} diff --git a/examples/declarative/toys/dial/content/background.png b/examples/declarative/toys/dial/content/background.png deleted file mode 100644 index 75d555d..0000000 Binary files a/examples/declarative/toys/dial/content/background.png and /dev/null differ diff --git a/examples/declarative/toys/dial/content/needle.png b/examples/declarative/toys/dial/content/needle.png deleted file mode 100644 index 2d19f75..0000000 Binary files a/examples/declarative/toys/dial/content/needle.png and /dev/null differ diff --git a/examples/declarative/toys/dial/content/needle_shadow.png b/examples/declarative/toys/dial/content/needle_shadow.png deleted file mode 100644 index 8d8a928..0000000 Binary files a/examples/declarative/toys/dial/content/needle_shadow.png and /dev/null differ diff --git a/examples/declarative/toys/dial/content/overlay.png b/examples/declarative/toys/dial/content/overlay.png deleted file mode 100644 index 3860a7b..0000000 Binary files a/examples/declarative/toys/dial/content/overlay.png and /dev/null differ diff --git a/examples/declarative/toys/dial/dial-example.qml b/examples/declarative/toys/dial/dial-example.qml deleted file mode 100644 index 900954f..0000000 --- a/examples/declarative/toys/dial/dial-example.qml +++ /dev/null @@ -1,50 +0,0 @@ -import Qt 4.7 -import "content" - -//! [0] -Rectangle { - color: "#545454" - width: 300; height: 300 - - // Dial with a slider to adjust it - Dial { - id: dial - anchors.centerIn: parent - value: slider.x * 100 / (container.width - 34) - } - - Rectangle { - id: container - anchors { bottom: parent.bottom; left: parent.left - right: parent.right; leftMargin: 20; rightMargin: 20 - bottomMargin: 10 - } - height: 16 - - radius: 8 - opacity: 0.7 - smooth: true - gradient: Gradient { - GradientStop { position: 0.0; color: "gray" } - GradientStop { position: 1.0; color: "white" } - } - - Rectangle { - id: slider - x: 1; y: 1; width: 30; height: 14 - radius: 6 - smooth: true - gradient: Gradient { - GradientStop { position: 0.0; color: "#424242" } - GradientStop { position: 1.0; color: "black" } - } - - MouseArea { - anchors.fill: parent - drag.target: parent; drag.axis: Drag.XAxis - drag.minimumX: 2; drag.maximumX: container.width - 32 - } - } - } -} -//! [0] \ No newline at end of file diff --git a/examples/declarative/toys/dial/dial.qmlproject b/examples/declarative/toys/dial/dial.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/toys/dial/dial.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} -- cgit v0.12