diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2013-12-07 17:33:25 +0200 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2013-12-07 17:33:25 +0200 |
| commit | ef5baad9ff47cfe32bb4f97368e0b3148765caa6 (patch) | |
| tree | 87d59ecc69e7981489e16aeed62115b4a4927223 /qml/pages/MassModel.qml | |
| parent | 3aeb00f43988ae607082cdabe124b9d5e123e33c (diff) | |
| download | unitmaster-ef5baad9ff47cfe32bb4f97368e0b3148765caa6.tar.gz unitmaster-ef5baad9ff47cfe32bb4f97368e0b3148765caa6.zip | |
shuffle stuff around and add directory for tests
Diffstat (limited to 'qml/pages/MassModel.qml')
| -rw-r--r-- | qml/pages/MassModel.qml | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/qml/pages/MassModel.qml b/qml/pages/MassModel.qml deleted file mode 100644 index cadcdf0..0000000 --- a/qml/pages/MassModel.qml +++ /dev/null @@ -1,50 +0,0 @@ -import QtQuick 2.0 - -ListModel { - function from(title, value) { - var functions = { - "kilogram": function () { return value; }, - "gram": function () { return value/1000.0; }, - "tonne": function () { return value*1000.0; }, - "pound": function () { return value*0.45359237; }, - "ounce": function () { return value*0.028349523125; } - }; - return functions[title](); - } - - function to(title, value) { - var functions = { - "kilogram": function () { return value; }, - "gram": function () { return value*1000.0; }, - "tonne": function () { return value/1000.0; }, - "pound": function () { return value/0.45359237; }, - "ounce": function () { return value/0.028349523125; } - }; - return functions[title](); - } - - ListElement { - title: "kilogram" - abbr: "kg" - } - - ListElement { - title: "gram" - abbr: "g" - } - - ListElement { - title: "tonne" - abbr: "t" - } - - ListElement { - title: "pound" - abbr: "lb" - } - - ListElement { - title: "ounce" - abbr: "oz" - } -} |
