From: Marcin Kaźmierczak Date: Tue, 25 Jan 2011 07:46:01 +0000 (+0100) Subject: first version of ComboBox X-Git-Url: http://vcs.maemo.org/git/?p=mdictionary;a=commitdiff_plain;h=5c8e1929ae3ae29c25a13c10d9b13e1580bf088e first version of ComboBox --- 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