How to port KIntSpinBox::setSuffix
David Faure
faure at kde.org
Tue Jun 3 15:59:18 UTC 2014
On Tuesday 03 June 2014 17:53:22 Kevin Ottens wrote:
> On Sunday 01 June 2014 10:34:07 David Faure wrote:
> > On Friday 30 May 2014 07:54:45 Martin Gräßlin wrote:
> > > Hi all,
> > >
> > > while trying to get rid of kdelibs4support I stumbled [1] over
> > > KIntSpinBox::setSuffix which allows to set a plural aware suffix. The
> > > recommendation is to port to QSpinBox, but as far as I can see there is
> > > suitable replacement for the plural aware suffix.
> > >
> > > What is the best solution to port this without introducing regressions?
> >
> > This appears to be missing currently.
> >
> > Laurent Montel asked me the same question on May 18, and I answered:
> > * this needs to be added to QSpinBox, but then that one would use the tr()
> > translation system
>
> That was the plan indeed.
>
> > * so we also need a KPluralHandlingSpinBox in a KF5 framework, to use the
> > ki18n translation system (basically resurrecting some code from
> > kdelibs4support, I assume).
>
> I'm not sure I get the reasoning leading to that conclusion. Can't be done
> upstream in Qt?
This is all about calling i18n() at runtime, from within the widget (when the
value changes), on a KLocalizedString member (-> i.e. it's based on a delayed
translation mechanism).
How do you do that from within Qt?
I can see it work with tr(), but not with i18n().
PS: Martin: meanwhile Laurent committed the class (which I reviewed) to
ktextwidgets, you can use that.
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140603/492efcdf/attachment.sig>
More information about the Kde-frameworks-devel
mailing list