I've noticed, that when I choose "Material Style" and then create ComboBox with a lot of elements in model it slides popup down when clicked for the 2nd time. The problem is that then I cannot choose last element in the ComboBox. I have already encountered this kind of problem (with sliding popup down and slightly right) when creating Dialogs/Popups, but then I used "parent: Overlay.overlay" and set x,y coordinates and everything works OK. This time I have no idea how to repair it.
Screenshots:
1st click on ComboBox:
2nd click on ComboBox:
Here is my code:
main.qml
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
Window {
id: window
width: 640
height: 480
visible: true
title: qsTr("Hello World")
ComboBox {
id: comboBox
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
model: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
}
}
main.py:
import sys
import os
from PySide2.QtGui import QGuiApplication
from PySide2.QtQml import QQmlApplicationEngine
if __name__ == "__main__":
app = QGuiApplication(sys.argv)
os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material"
engine = QQmlApplicationEngine()
engine.load(os.path.join(os.path.dirname(__file__), "main.qml"))
if not engine.rootObjects():
sys.exit(-1)
sys.exit(app.exec_())

