I have a strange behavior that is annoying me when I try to do this code:
import QtQuick 2.7
import QtQuick.Controls 2.0
ApplicationWindow {
id: window
visible: true
width: 640
height: 480
Rectangle {
color: "green"
width: parent.width/2
height: parent.height
anchors.right : parent.right
ComboBox {
id:combo
popup.visible: combo.activeFocus
model: [ "Banana", "Apple", "Coconut" ]
}
}
CheckBox {
id:check
}
}
If I click on the CheckBox
and then on theComboBox
, theComboBox.popup
will appears during 1 ms and then disapears.
I don't understand why because activeFocus = true
Do you have any idea why ?
This behavior is to be expected, if you follow the chain of events leading to it:
ComboBox
ComboBox
gains activeFocus
ComboBox.popup
becomes visible
ComboBox
becoms invisible.Remove the line
popup.visible: combo.activeFocus
and you are fine.
Control the visibility via open()
and close()
instead.