Qt-interest Archive, March 2002
QComboBox::setCurrentItem(int) bug?
Message 1 in thread
Why isn't QComboBox::activated(int)/activated(QString) emitted when I call
setCurrentItem(int)?
I'm connecting to the activated() signal in my widget to do some setup
when the user selects from a QComboBox, but I need this setup to work if I
select ComboBox items in the code as well.
If it's a bug, is there any way around this? (except deriving from
QComboBox and making my own stuff...)
--
[ signature omitted ]
Message 2 in thread
I believe that activated only applies to user input, it does not apply
when you use the setCurrentItem. Something similiar applies with the
allowDuplicates property (I think that's what it's called) I.E if this is
set to false (no dups) then users can not enter any duplicate data,
however if somewhere in the code a duplicate entry is added this property
doesn't apply. My hunch is that this is working along the same lines.
On Fri, 1 Mar 2002, Tarjei Knapstad wrote:
> Why isn't QComboBox::activated(int)/activated(QString) emitted when I call
> setCurrentItem(int)?
>
> I'm connecting to the activated() signal in my widget to do some setup
> when the user selects from a QComboBox, but I need this setup to work if I
> select ComboBox items in the code as well.
>
> If it's a bug, is there any way around this? (except deriving from
> QComboBox and making my own stuff...)
>
> --
> Tarjei Knapstad
>
> --
> List archive and information: http://qt-interest.trolltech.com
>
Message 3 in thread
On Fri, 1 Mar 2002, David M. Hirst wrote:
> I believe that activated only applies to user input, it does not apply
> when you use the setCurrentItem. Something similiar applies with the
> allowDuplicates property (I think that's what it's called) I.E if this is
> set to false (no dups) then users can not enter any duplicate data,
> however if somewhere in the code a duplicate entry is added this property
> doesn't apply. My hunch is that this is working along the same lines.
>
I just read throught the Qt code of setCurrentItem, and it seems like
you're wrong:
internalHighlight( index );
// internalActivate( index ); ### this leads to weird behavior, as in 3.0.1
so there appears to be an unresolved bug here...
(internalHighligh/Activate emits the highlighted/activated signals).
I'll try connecting to the highlighted signal instead.
>
> > Why isn't QComboBox::activated(int)/activated(QString) emitted when I call
> > setCurrentItem(int)?
> >
> > I'm connecting to the activated() signal in my widget to do some setup
> > when the user selects from a QComboBox, but I need this setup to work if I
> > select ComboBox items in the code as well.
> >
> > If it's a bug, is there any way around this? (except deriving from
> > QComboBox and making my own stuff...)
> >
> > --
> > Tarjei Knapstad
> >
> > --
> > List archive and information: http://qt-interest.trolltech.com
> >
>
--
[ signature omitted ]
Message 4 in thread
Guess I should RTM more....
On Fri, 1 Mar 2002, Tarjei Knapstad wrote:
> On Fri, 1 Mar 2002, David M. Hirst wrote:
>
> > I believe that activated only applies to user input, it does not apply
> > when you use the setCurrentItem. Something similiar applies with the
> > allowDuplicates property (I think that's what it's called) I.E if this is
> > set to false (no dups) then users can not enter any duplicate data,
> > however if somewhere in the code a duplicate entry is added this property
> > doesn't apply. My hunch is that this is working along the same lines.
> >
> I just read throught the Qt code of setCurrentItem, and it seems like
> you're wrong:
>
> internalHighlight( index );
> // internalActivate( index ); ### this leads to weird behavior, as in 3.0.1
>
> so there appears to be an unresolved bug here...
> (internalHighligh/Activate emits the highlighted/activated signals).
>
> I'll try connecting to the highlighted signal instead.
>
> >
> > > Why isn't QComboBox::activated(int)/activated(QString) emitted when I call
> > > setCurrentItem(int)?
> > >
> > > I'm connecting to the activated() signal in my widget to do some setup
> > > when the user selects from a QComboBox, but I need this setup to work if I
> > > select ComboBox items in the code as well.
> > >
> > > If it's a bug, is there any way around this? (except deriving from
> > > QComboBox and making my own stuff...)
> > >
> > > --
> > > Tarjei Knapstad
> > >
> > > --
> > > List archive and information: http://qt-interest.trolltech.com
> > >
> >
>
> --
> Tarjei Knapstad
>
> --
> List archive and information: http://qt-interest.trolltech.com
>
Message 5 in thread
On Fri, 1 Mar 2002, David M. Hirst wrote:
> Guess I should RTM more....
>
Well, that goes for me too I guess. If I had read through the code in the
first place it would have saved me this post... :) (Allthough I don't
consider browsing the code as reading the manual exactly...)
I guess a list of known bugs in Qt wouldn't hurt the users? Saves everyone
some time...
--
[ signature omitted ]