[Interest] QCombox::currentIndexChanged(QString) emitted twice?
tony at rightsoft.com.au
Wed Oct 17 17:11:14 CEST 2012
> Sent: Thursday, 18 October 2012 12:22 AM
> today I discovered that obviously the SIGNAL
> QComboBox::currentIndexChanged(QString) is emitted twice when I select a
> different item. The first time QString contains the previous string and
> second time it contains the new string.
> Can I rely on this previous/next behaviour?
> This would save a lot of work for me in implementing some extra tracking
> what was selected previously.
> Kind regards
That definitely sounds like a bug to me at your end. I've only used the
integer version of the signal, and I've never got double signals like that.
In my sources (C:\qt\4.8.3\src\gui\widgets\qcombobox.cpp(1258)), the two
different signals are always sent together, so you should only get one as
well. I've used most versions since 4.3.
What is your configuration, version, OS, etc?
Are you supplying your own model to the combo box?
Do the Qt test programs have the same problem - I assume there must be one
with a slot for either of these signals?
More information about the Interest