Private Practice: What’s in a Proxy-Style?

A new session in the private practice, “What’s in a Proxy Style?”, examines QProxyStyle and derives some important caveat when applying a classical Design Pattern.

This is the original-language version of my recent Mythos Proxy-Style article.

Advertisements

Heise Developer: Mythos Proxy-Style

For you German speakers out there, my fifth Heise Developer article, “Mythos Proxy-Style: Wie eine verspätete Klasse neues Licht auf ein bekanntes Entwurfsmuster wirft” just went live on Heise’s site.

It examines the implementation of QProxyStyle in Qt 4.6 and, from that analysis, derives an important caveat regarding the applicability of a certain well-known design pattern.

This is the German translation of an unpublished English-language original, which I will publish here after a grace period.

From the article:

In der Qt-Gemeinde existiert ein Mythos: “QProxyStyle”. Auf der einen Seite stehen Entwickler wie David Faure, seines Zeichens KDE-Urgestein und geschätzter Kollege des Autors, die behaupten, ein QProxyStyle sei unmöglich. Auf der anderen Seite stehen Entwickler von Qt-Erweiterungen, die einen QProxyStyle entwickelt haben wollen. Eine Spurensuche im Märchenwald deckt interessante Komplikationen bei der Anwendung eines bekannten Entwurfsmusters auf.

Effective Qt: Don’t be sub-class when subclassing

The first of my Effective Qt columns, “Don’t be sub-class when subclassing“, just went live on my site.

Here are the guidelines this item covers:

  • When subclassing QObject (directly or indirectly), always add the Q_OBJECT macro, regardless of whether you also define signals or slots.
  • Prefer to offer all base class constructors in subclasses, too.
  • Prefer to offer the basic QObject constructor ( QObject * parent=0 ) when subclassing QObjects. Always offer the basic QWidget constructor ( QWidget * parent=0, Qt::WindowFlags f=0 ) when subclassing QWidget.
  • Prefer to follow the Qt constructor pattern: When inheriting QObjects, end constructor argument lists in QObject * parent=0. When inheriting QWidgets, end constructor argument lists in QWidget * parent=0, Qt::WindowFlags f=0. Add additional arguments at the beginning of the argument list.

I hope to make this into a regular column, time permitting.

Protected: What’s in a Proxy Style?

This content is password protected. To view it please enter your password below: