Watching my Ks and Qs

The good thing about transatlantic flights is that it gives me an opportunity to watch movies on a tiny screen that I otherwise wouldn’t watch at all. On my outbound flight to the US last week I managed to watch Shrek and most, but not all of Toy Story 3. I needed closure though. Will Woody unite the toys and save the day? Will Buzz ever be the same again? The return flight yesterday(today?) brought the closure, but also gave me some time to work on something I’ve been putting off for a while.

I originally wrote KIdentityProxyModel with the intent of putting it into Qt on request. Once it gets into Qt I’m no longer the maintainer, so someone else in Nokia gets to decide whether to apply patches I submit to it. I needed to make sure it was as correct as possible before submitting it so it went into kdelibs for an incubation period.

There are many style and structural differences between kdelibs classes and Qt classes. Documentation in kdelibs is usually in the header file, whereas in Qt it is always in the implementation file. In kdelibs, we use a _k_ prefix for Q_PRIVATE_SLOTS, whereas Qt uses a _q_ prefix. Easily updated with some perl dash pie. Another difference is that the protected constructor takes an instance of the private class as a reference instead of as a pointer. I only recently realized the reasons for doing it that way. Finally, In the case of proxy models, the source model is usually referred to as d->model instead of q->sourceModel(). That’s possible in Qt, but not in kdelibs because of the inheritance of QAbstractProxyModelPrivate.

With all of those changes made I submitted the MR for the patch that mostly I wrote around the time of Akademy in July. It’s an interesting time to be submitting classes to Qt, not least because of the column inches it is getting these days. Contributors are eager to find out the extent that the Qt Open Governance model will facilitate these kinds of contributions and make them easier and sustainable.

In a KDE context it is even more interesting. There has been lots of discussion since the end of last week about the role of the kde libraries in the greater Qt ecosystem. Do Qt developers know useful libraries are in kdelibs? How can we make those libraries easier to find, access, and use? One proposal is to attempt to submit as much as possilble of kde libraries into Qt itself. That would require dramatic changes to the current maintenance and contribution model, so it will be interesting to see where that goes.

About these ads

3 Responses to “Watching my Ks and Qs”

  1. Daniel Albuschat Says:

    The thing with KDE is that it is not portable, so my guess is that kdelibs is not portable, either. Since the KDE on windows effort is progressing horribly slow, maybe this is a chance to give it a boost.

  2. steveire Says:

    Hi Daniel,

    KDE is portable of course. Saying it is not is spreading a myth. KDE libraries and applications run on Windows desktops, Windows CE phones and Mac as well as Maemo/Meego and linux.

  3. Daniel Albuschat Says:

    Yeah, sure… as I said there are efforts porting it to Windows, for example. But the last snapshot I tried was not stable at all. Of course I don’t know whether this is the application’s fault or the library’s fault, but I supposed it was a mix of both.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: