summaryrefslogtreecommitdiffstats
path: root/examples/declarative-radio
diff options
context:
space:
mode:
authorJonas Rabbe <jonas.rabbe@nokia.com>2011-08-30 10:46:19 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-30 07:40:43 +0200
commit8e954ee2462e827e88bbc27b1512d1e1422357fc (patch)
tree88b73d9ce7ce22fd34eab11fc86e795446273e97 /examples/declarative-radio
parent7535629ecb4a4af6c003ea0b3ba7e5eca6f1d847 (diff)
Added QML API for getting the limits for a specific radio band.
Using properties for the frequency step, minimum and maximum frequency of the currently selected band. Also updated the declarative-radio example to use the minimum and maximum frequencies to show a tuner band for the radio. Change-Id: I9f28f10e98e008c14b10bdc12b0727086cd45f0b Reviewed-on: http://codereview.qt.nokia.com/3829 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Diffstat (limited to 'examples/declarative-radio')
-rw-r--r--examples/declarative-radio/view.qml30
1 files changed, 27 insertions, 3 deletions
diff --git a/examples/declarative-radio/view.qml b/examples/declarative-radio/view.qml
index e598cb354..cb7623497 100644
--- a/examples/declarative-radio/view.qml
+++ b/examples/declarative-radio/view.qml
@@ -46,11 +46,13 @@ Rectangle {
Radio {
id: radio
+ band: Radio.FM
}
Column {
anchors.fill: parent
anchors.margins: 5
+ spacing: 5
Row {
@@ -61,7 +63,7 @@ Rectangle {
height: 200
verticalAlignment: Text.AlignVCenter
- text: "" + radio.frequency / 1000 + " kHz";
+ text: "" + radio.frequency / 1000 + " kHz"
}
Text {
id: sig
@@ -74,6 +76,28 @@ Rectangle {
}
}
+ Row {
+ spacing: 5
+
+ Rectangle {
+ width: 350
+ height: 10
+
+ color: "black"
+
+ Rectangle {
+ width: 5
+ height: 10
+ color: "red"
+
+ y: 0
+ x: (parent.width - 5) * ((radio.frequency - radio.minimumFrequency) / (radio.maximumFrequency -
+ radio.minimumFrequency))
+
+ }
+ }
+ }
+
Row {
spacing: 5
@@ -119,7 +143,7 @@ Rectangle {
anchors.fill: parent
onClicked: {
var f = radio.frequency;
- f = f - radio.frequencyStep(Radio.FM);
+ f = f - radio.frequencyStep;
radio.setFrequency(f);
}
}
@@ -144,7 +168,7 @@ Rectangle {
anchors.fill: parent
onClicked: {
var f = radio.frequency;
- f = f + radio.frequencyStep(Radio.FM);
+ f = f + radio.frequencyStep;
radio.setFrequency(f);
}
}