[Kmymoney-devel] restoring QWidget::updatesEnabled property

Cristian Oneţ onet.cristian at gmail.com
Sat Jul 25 10:15:55 CEST 2009


În data de Sîmbătă 25 Iulie 2009 10:01:12 ați scris:
> On Friday 24 July 2009 22:02:00 Cristian Oneț wrote:
> > SVN commit 1002027 by conet:
> >
> > The transaction form is now visible.
> >
> > I don't know why tough it got updatesEnables set to false.
>
> Can you investigate this a bit further? The current way you do things may
> work at the moment, but I remember it caused me many headaches in the past
> not reverting the updateEnabled state to what it was before I turned it
> off.
Hi,

Let's make this is topic the first one to be discussed on this mailing list :).
My thoughts about this: the only widgets in kmymoney that after calling 
setUpdatesEnabled(false) try to restore the result of updatesEnabled() are the 
register and the transaction form.

The difference between the documentation of QWidget::updatesEnabled property in 
qt3 and qt4 is that in the qt4 doc it is stated that:
"Disabling a widget implicitly disables all its children. Enabling a widget 
enables all child widgets except top-level widgets or those that have been 
explicitly disabled"

So I suspect that the following thing happens:
The updatesEnabled flag is restored to "disabled" (caused by calling the code 
while the updatesEnabled is disabled due to a parent widget) and it then never 
gets set to enabled (when re-enabling updates for the parent) due to the fact 
that "Enabling a widget enables all child widgets except top-level widgets or 
those that have been explicitly disabled". So we do an explicit disabling by 
mistake. Which is the parent that gets disabled? I don't know it's sure that 
it's not in the kmymoney code.

So why does the register avoids this since there is code that does the same 
thing in the register?
The register has code to explicitly enable updates in 
KGlobalLedgerView::slotUpdateViewPos(void) where m_register-
>setUpdatesEnabled(true) is called.

This is why I think that trying to restore the flag does not work for the 
transaction form unless we have some call to explicitly enable the updates 
like we do for the register.

-- 
Regards,

Cristian Oneţ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20090725/992e3658/attachment.sig 


More information about the KMyMoney-devel mailing list