diff options
| author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-02-27 14:02:22 +0100 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-01 11:05:58 +0100 |
| commit | b0d19a08b4f34859c8643495d1910690c48644c9 (patch) | |
| tree | 99c1df3b9763abaff24a1f1b8ff54c88b1f6c0d6 /src/controls/ComboBox.qml | |
| parent | 6215e42377fbe5bc0e67a08702bede2982a363d9 (diff) | |
| download | qtquickcontrols-b0d19a08b4f34859c8643495d1910690c48644c9.tar.gz | |
MenuBar, Menu, MenuItem, Action: New, reviewed API
Change-Id: Ic018c0d9c61ddf6fdf05750bf172cf5e306d0508
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/controls/ComboBox.qml')
| -rw-r--r-- | src/controls/ComboBox.qml | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index f5dbaca8..9f430312 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -97,14 +97,14 @@ import "Styles/Settings.js" as Settings Control { id: comboBox - default property alias menuItems: popup.menuItems + default property alias items: popup.items property alias model: popup.model property alias textRole: popup.textRole property alias selectedIndex: popup.selectedIndex readonly property alias selectedText: popup.selectedText - readonly property bool pressed: mouseArea.pressed && mouseArea.containsMouse || popup.popupVisible + readonly property bool pressed: mouseArea.pressed && mouseArea.containsMouse || popup.__popupVisible /* \internal */ property alias __containsMouse: mouseArea.containsMouse @@ -123,13 +123,14 @@ Control { ExclusiveGroup { id: eg } StyleItem { id: styleItem } + Component.onCompleted: { if (selectedIndex === -1) selectedIndex = 0 if (styleItem.style == "mac") { popup.x -= 10 popup.y += 4 - popup.font.pointSize = 13 + popup.__font.pointSize = 13 } } @@ -144,7 +145,8 @@ Control { property int x: 0 property int y: centerSelectedText ? 0 : comboBox.height - minimumWidth: comboBox.width + __minimumWidth: comboBox.width + visualParent: comboBox function finalizeItem(item) { item.action.checkable = true @@ -152,9 +154,9 @@ Control { } function show() { - menuItems[comboBox.selectedIndex].checked = true - currentIndex = comboBox.selectedIndex - showPopup(x, y, centerSelectedText ? comboBox.selectedIndex : 0, comboBox) + items[comboBox.selectedIndex].checked = true + __currentIndex = comboBox.selectedIndex + __popup(x, y, centerSelectedText ? comboBox.selectedIndex : 0) } } |
