summaryrefslogtreecommitdiff
path: root/src/controls/ComboBox.qml
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-09-26 10:56:26 +0200
committerJ-P Nurmi <jpnurmi@digia.com>2014-09-30 15:27:06 +0200
commite1ba563285270fd20e0aa8b9692b1bf1686b0128 (patch)
tree642863bfafe1287b45a10a14d3839a8951a16a41 /src/controls/ComboBox.qml
parent00665083ce5ccccab00b852164f03fe1efa9c504 (diff)
downloadqtquickcontrols-e1ba563285270fd20e0aa8b9692b1bf1686b0128.tar.gz
qquickmenu: add support for providing a target rect to __popup()
Using a target rect as menu location instead of a position has been supported in QPlatformMenu for a while. The reason for specifying a rect instead of a position is that then the OS can decide if the popup should be placed above or below the target rect so that it fits inside the screen. A typical example is when showing an edit menu around a text selection. If the selection (target rectangle) is far up on the screen, the popup (with arrow) will be placed below the selection instead of above, which is the normal. Change-Id: Ie6cd6a92f1d9ef480c1e455960021c7f18f86569 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/ComboBox.qml')
-rw-r--r--src/controls/ComboBox.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index 55161d39..5252b4e5 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -633,9 +633,9 @@ Control {
items[__selectedIndex].checked = true
__currentIndex = comboBox.currentIndex
if (Qt.application.layoutDirection === Qt.RightToLeft)
- __popup(comboBox.width, y, isPopup ? __selectedIndex : 0)
+ __popup(Qt.rect(comboBox.width, y, 0, 0), isPopup ? __selectedIndex : 0)
else
- __popup(0, y, isPopup ? __selectedIndex : 0)
+ __popup(Qt.rect(0, y, 0, 0), isPopup ? __selectedIndex : 0)
}
}