[Gambas-user] about listbox mode multi

Ron Onstenk ronstk at ...239...
Tue Jul 25 00:02:09 CEST 2006


On Monday 24 July 2006 22:21, Benoit Minisini wrote:
> On Sunday 23 July 2006 15:15, Ron Onstenk wrote:
> > On Sunday 23 July 2006 14:45, Benoit Minisini wrote:
> > > Argh! There is an "optimization" in Qt that makes the ListBox signaling
> > > changes in selection only when the mouse button is released (in Multi and
> > > Extended modes). And the click event is of course signaled when the mouse
> > > button is pressed. So your problem...
> > >
> > > I will try to find a workaround...
> >
> > Part of the qt listbox code is also used in Listview?
> > I had with Listview and multi/extended mode also some
> > problems that look to me the same as this.
> >
> > I could workaround with mousedown and mouseup events and
> > setting a flag to signal the difference.
> > I was suspecting my own quality :)
> >
> > Because the Columnview, Listview and Treeview are all
> > based on same partial code in gambas and qt I'm afraid
> > it count there to, the "optimization" from QT.
> >
> > Ron
> >
> 
> I have changed the way Select events are delivered with ListBox and ListView. 
> Now they are posted, i.e. delivered one event loop later.
Will see how it works now. 
First I have to work now on the printing part in a hurry.

> 
> The consequence is that now the behaviour is more logical. 
> But it can't be perfect. 
> Moreover, I can't have the same behaviour between ListBox and ListView.
> 
> Anyway, you should not rely on what the current item is during a Select event 
> in Multi or Extended selection mode.
I do a iteration over the listbox items for .item.Selected in case one of them
was the mode of the listbox (as done in example for Multi).

> 
> Moreover, in these modes, The Click event is raised for each selected element 
> with the ListBox, but only for the first selected one with the ListView.
> 
> A last note: ListView, TreeView and ColumnView are based on the same QT 
> widget, so all what I said applies to them too.
I have seen in C source already.

> 
> Regards,
> Benoit

Greets from warm evening in Holland

Ron




More information about the User mailing list