开发者

QComboBox with single value: Select this value

开发者 https://www.devze.com 2022-12-12 23:15 出处:网络
I have a QComboBox which changes its selection possibilities depending on certain conditions. Because of special combinations, it might have only one selection left over, which has to be \"confirmed\

I have a QComboBox which changes its selection possibilities depending on certain conditions. Because of special combinations, it might have only one selection left over, which has to be "confirmed" by the user, preferably by looking at all possible selections, seeing that there is only one, and then selecting this.

My problem: If a user selects the only optio开发者_C百科n there is, the value is never set, i.e. no signal is sent. Is there a way to circumvent this?


Use SIGNAL(highlighted(...)) instead of SIGNAL(activated(...)). Or do a setCurrentIndex(-1) before, this should work with activated().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号