Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, March 2008
Re: Combo Box Problem (Deferred delete)


Message 1 in thread

>> it looks like both 4.3.4 and 4.4 are doing the right thing.

I did not have 4.3.x installed any more so I didn't test that.  Our application is definitely showing different behavior with 4.4, though.  I'm sure there is something with deferred delete.  You're saying that it is correct for the line edit to cover the combo box when editing has been disabled?

I understand that this is probably lower priority, so we've restructured our app a little so that this doesn't happen. This is no longer a problem for us, but it probably will affect others.

Rob

----- Original Message -----
From: Bradley T. Hughes <bhughes@xxxxxxxxxxxxx>
To: LEFEBVRE,ROB (A-USA,ex1)
Cc: qt4-preview-feedback@xxxxxxxxxxxxx <qt4-preview-feedback@xxxxxxxxxxxxx>; PARKER,TOM (A-Sonoma,ex1)
Sent: Tue Mar 11 03:18:58 2008
Subject: Re: Combo Box Problem (Deferred delete)

Hi Rob,

Sorry for the late reply, it's been a bit busy around here after the 4.4.0 beta.

rob_lefebvre@xxxxxxxxxxx wrote:
> There is an issue with the deferred delete that effects the combo box.
> Put a combo box on a dialog, and construct the dialog from an event handler. Set
> and reset the editable property. This will create a line edit that is then
> marked for deferred deletion at line 1563 of qcombobox.cpp in void
> QComboBox::setEditable(bool editable). The problem is that the line edit
> never gets deleted because we are in an event handler, so it stays on the
> dialog box. (Perhaps setting it invisible would help???) I've replicated it
> on 32-bit Windows Vista.
> 
> This code works in Qt 4.3.4. It also works if the combo box is on the
> main window, which made initial replication of the problem in a simple program
> tricky!

I've tried your code on Windows XP with both 4.3.4 and 4.4, and I see the 
exact same behavior in both versions (the line edit is not deleted and 
covers the combobox). I'll have a colleague of mine try on Vista as well, 
but at first glance, it looks like both 4.3.4 and 4.4 are doing the right thing.

-- 
 [ signature omitted ] 

Message 2 in thread

rob_lefebvre@xxxxxxxxxxx wrote:
>>> it looks like both 4.3.4 and 4.4 are doing the right thing.
> 
> I did not have 4.3.x installed any more so I didn't test that. Our
> application is definitely showing different behavior with 4.4, though. I'm
> sure there is something with deferred delete. You're saying that it is
> correct for the line edit to cover the combo box when editing has been disabled?

With regards to how DeferredDelete works in Qt 4. (since 4.0), the behavior 
you see is correct. After calling deleteLater() on an object, it will not be 
deleted until the calling frame returns to the event loop (it will never be 
deleted if the event loop recurses by entering a modal event loop).

> I understand that this is probably lower priority, so we've restructured
> our app a little so that this doesn't happen. This is no longer a problem
> for us, but it probably will affect others.

Regressions get top priority here. Some changes in behavior are intended, 
and we will document those in the changes file. But for things like 
DeferredDelete, I definitely don't want that to change behavior. :)

If you can manage to find a test case that works with 4.3 but not with 4.4, 
I want to see it.

-- 
 [ signature omitted ]