diff options
author | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-09-29 13:05:35 +0300 |
---|---|---|
committer | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-11-22 10:41:32 +0000 |
commit | 1b5cb34a106560e5ee7d2d00c77fddf61ff4c327 (patch) | |
tree | a45ad44cdc66e826acb363f245bd8f8cc3b0122c /src/settingsui/timedate/CustomComboBox.qml | |
parent | 366c0c0e392c27624f22d3bb3c0e6732e1de04f6 (diff) |
Fix CustomComboBox
It's not possible to calculate popup height from the ComboBox y
coordinate, it does not work with columns and rows. Height must be
set by the user of the component who can calculate it correctly. Added
itemsVisible property for quick height selection.
Task-number: QTBUG-63091
Change-Id: I3f1a86545b7df58f453b98ce2e1f3a7bce9cc732
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
Diffstat (limited to 'src/settingsui/timedate/CustomComboBox.qml')
-rw-r--r-- | src/settingsui/timedate/CustomComboBox.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/settingsui/timedate/CustomComboBox.qml b/src/settingsui/timedate/CustomComboBox.qml index e7e1da4..3c8e752 100644 --- a/src/settingsui/timedate/CustomComboBox.qml +++ b/src/settingsui/timedate/CustomComboBox.qml @@ -32,6 +32,7 @@ import QtGraphicalEffects 1.0 ComboBox { id: comboBox + property int itemsVisible: 5 indicator: Image { id: indicatorImage height: comboBox.height * 0.4 @@ -69,13 +70,12 @@ ComboBox { popup: Popup { y: comboBox.height -1 width: comboBox.width - implicitHeight: contentItem.implicitHeight + height: comboBox.height * comboBox.itemsVisible padding: 1 contentItem: ListView { id: listView clip: true - implicitHeight: root.height - (comboBox.y + comboBox.height) model: comboBox.popup.visible ? comboBox.delegateModel : null currentIndex: comboBox.currentIndex onCurrentIndexChanged: positionViewAtIndex(listView.currentIndex, ListView.beginning) |