[Kde-games-devel] KDE theme colors API for QML

Kevin Krammer krammer at kde.org
Wed Aug 7 08:54:51 UTC 2013


On Tuesday, 2013-08-06, Albert Astals Cid wrote:
> El Dimecres, 7 d'agost de 2013, a les 01:11:20, Viranch Mehta va escriure:
> > On Tue, Aug 6, 2013 at 3:10 PM, Kevin Krammer <krammer at kde.org> wrote:
> > > On Tuesday, 2013-08-06, Денис Купляков wrote:
> > >> >> I see only one way: we simply doing all our stuff by directly
> > >> >> changing KColorScheme class: adding Q_OBJECT and Q_ENUMS
> > >> >> statements to it, than going by SECOND approach. What is your
> > >> >> opinion about all of this?
> > >> > 
> > >> > That is not possible, KColorScheme is not a QObject derived class.
> > >> 
> > >> I mean we will make KColorScheme QObject derived too. I think this
> > >> changes shouldn't break any code.
> > > 
> > > Ah. Unfortunately changing the inheritance tree does break binary
> > > compatibilty.
> > > See "Do's and Don'ts" of [1]
> > 
> > Can we do it before a major release? I guess 4.10 -> 4.11 transition
> > qualifies for a major release, for example?
> 
> No, all 4.x have to be source and binary compatible (in kdelibs, other libs
> can have other less strict guidelines), it could be done for Frameworks 5.

I think it is also important to keep in mind that such a change effects the 
usage pattern for a class considerably.

KColorScheme is currently a value class, it can be copied, passed around and 
stored without any concern for ownership.
A QObject derived class can not and is additionally bound to the thread that 
created it.

The easiest way might be to create an enum holder class that is registered as 
an uncreatable type, i.e. just service as a namespace for the enum(s).
BlackBerry's Cascades framework does that a lot [1]

Cheers,
Kevin

[1] LayoutOrientation is a class only holding a Type enum, used as the value 
for a different' class' properties, e.g. StackLayout's orientation property
https://developer.blackberry.com/cascades/reference/bb__cascades__stacklayout.html
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- 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-games-devel/attachments/20130807/0ad3598e/attachment.sig>


More information about the kde-games-devel mailing list