[Qt-interest] A new (?) const-correct way to create aUiobjectand do setupUi
Robert Hairgrove
evorgriahr at hispeed.ch
Tue Feb 8 18:39:34 CET 2011
On Tue, 2011-02-08 at 18:35 +0100, Thiago Macieira wrote:
> Em terça-feira, 8 de fevereiro de 2011, às 18:19:07, Robert Hairgrove
> escreveu:
> > Once again, regarding const and non-const:
> >
> > Even if I could call non-const functions on the pointer members of the
> > const ui object, as Thiago has pointed out (no pun intended!), I
> > wouldn't be able to call retranslateUi() on the object after creation
> > which would mean that if my application allows the user to switch
> > languages dynamically, it wouldn't work unless that function were
> > declared const.
> >
> > That's a limitation I wouldn't want to live with.
>
> That actually means retranslateUi should be a const function.
Yes. :)
Is there anything that speaks against it?
More information about the Qt-interest-old
mailing list