当我尝试执行此代码时,我有一个奇怪的行为让我很恼火:
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
}
}
如果我单击CheckBox
,然后单击ComboBox
,ComboBox.popup
将在 1 毫秒内出现然后消失。我不明白为什么,因为activeFocus = true
你知道为什么吗?