From 5c8e1929ae3ae29c25a13c10d9b13e1580bf088e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20Ka=C5=BAmierczak?= Date: Tue, 25 Jan 2011 08:46:01 +0100 Subject: [PATCH] first version of ComboBox --- src/mdictionary/mdictionary.pro | 5 +- src/mdictionary/qml/ComboBox.qml | 174 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 src/mdictionary/qml/ComboBox.qml diff --git a/src/mdictionary/mdictionary.pro b/src/mdictionary/mdictionary.pro index 68ae08d..bf2966b 100644 --- a/src/mdictionary/mdictionary.pro +++ b/src/mdictionary/mdictionary.pro @@ -102,7 +102,8 @@ OTHER_FILES += \ qml/Checkbox.qml \ qml/MySpinBox.qml \ qml/SettingsWidget.qml \ - qml/HistoryListDialog.qml + qml/HistoryListDialog.qml \ + qml/ComboBox.qml target.path = $$BIN_DIR INSTALLS += target @@ -200,6 +201,7 @@ unix { qmls.files += ./qml/Checkbox.qml qmls.files += ./qml/MySpinBox.qml qmls.files += ./qml/SettingsWidget.qml + qmls.files += ./qml/ComboBox.qml } else:maemo5 { qmls.path = $$DATA_DIR/qml @@ -225,6 +227,7 @@ unix { qmls.files += ./qml/MySpinBox.qml qmls.files += ./qml/SettingsWidget.qml qmls.files += ./qml/HistoryListDialog.qml + qmls.files += ./qml/ComboBox.qml } INSTALLS += desktop icon64 shared service css css_images qmls diff --git a/src/mdictionary/qml/ComboBox.qml b/src/mdictionary/qml/ComboBox.qml new file mode 100644 index 0000000..34112a7 --- /dev/null +++ b/src/mdictionary/qml/ComboBox.qml @@ -0,0 +1,174 @@ +import Qt 4.7 + +Rectangle { + id: rectangle1 + radius: 10 + border.color: "#000666"; +// property int maxValue:500; +// property int minValue:0; + property alias value:text1.text + property bool expanded: false + + function show(Boolean){ + //mozna jeszcze to w tle ukrywać + expanded = Boolean + } + + signal valueSelected(string selected); //? + +// function stringToInt(string){ +// var value=0; +// var pow10=1; +// for (var i=string.length-1;i>=0;i--){ +// value+=(string.charCodeAt(i)-48)*pow10; +// pow10= pow10*10; +// } +// if(value>maxValue) +// return maxValue; +// if(value