<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
we also had a short discussion about the Q_DECLARE_PRIVATE macro and
friends. JC initially used macros and template classes adapted from Qxt
(the CTK_DECLARE_PRIVATE etc. macros and the ctkPrivate template
class). I haven't had a look at them in detail yet, so I don't know
what their benefits are compared to the Qt "native" way.<br>
<br>
The only thing about which I am a little bit worried is that
Q_DECLARE_PRIVATE, Q_D, Q_P, Q_DISABLE_COPY etc. is not public API
(e.g. it is not documented in the official Qt docs). However, I think
many people use them and are familiar with them. Shall we use familiar,
but non-official features of Qt or roll our own macros?<br>
<br>
<br>
See for example this discussion:<br>
<br>
<a class="moz-txt-link-freetext" href="http://lists.trolltech.com/qt-interest/2007-09/thread00325-0.html">http://lists.trolltech.com/qt-interest/2007-09/thread00325-0.html</a><br>
<br>
The interesting part is:<br>
<br>
<pre>> On 14.09.07 13:49:48, Thiago Macieira wrote:
> > Note of warning: Q_DECLARE_XXXX are not documented. You're not supposed
> > to use them.
>
> Yet they are documented and advertised to be used on
> <a
href="http://techbase.kde.org/Policies/Library_Code_Policy#D-Pointers">http://techbase.kde.org/Policies/Library_Code_Policy#D-Pointers</a>
Let me put my KDE hat.
===> KDE developer speaking <===
I know. I wrote that potion of the policy.
KDE is using those macros. KDE is also using other non-documented features and
functions in Qt.
==========
However, as a Trolltech developer, I have to tell you: those macros are
undocumented. Trolltech can change them from one release to the next. What's
more, if you have a problem with them and mail qt-bugs@xxxxxxxxxxxxx or
support@xxxxxxxxxxxxx, the support engineers will tell it's internal API and
they can't help you. (Though, of course, they'll be more polite than me)
KDE is at its own risk doing that. And the side-effects of that have shown up
recently: take a look at this change in that very same page:
<a
href="http://techbase.kde.org/index.php?title=Policies%2FLibrary_Code_Policy&diff=13707&oldid=13098">http://techbase.kde.org/index.php?title=Policies%2FLibrary_Code_Policy&diff=13707&oldid=13098</a>
I removed the notice about QAtomic. Why? Because QAtomic -- an undocumented
class in Qt 4.0 through 4.3 -- has disappeared in Qt 4.4. And KDE is using
it.
</pre>
<br>
<br>
On 04/22/2010 08:28 PM, Julien Finet wrote:
<blockquote
cite="mid:q2p5b9fa8231004221128lb7d900a5x18072906afba80cf@mail.gmail.com"
type="cite">
<div>Good idea ! </div>
<div>If we have to follow the Qt naming convention for classes that
derive from Qt, then we should probably use the same keywords...</div>
<div>Julien.</div>
<br>
<div class="gmail_quote">On Thu, Apr 22, 2010 at 2:14 PM, Arnaud
GELAS <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:arnaud_gelas@hms.harvard.edu">arnaud_gelas@hms.harvard.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
I just wanted to know what's the policy for constructor by copy?<br>
Do you want to use Q_DISABLE_COPY macro declared in private?<br>
<br>
Arnaud<br>
_______________________________________________<br>
Ctk-developers mailing list<br>
<a moz-do-not-send="true" href="mailto:Ctk-developers@commontk.org"
target="_blank">Ctk-developers@commontk.org</a><br>
<a moz-do-not-send="true"
href="http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers"
target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers</a><br>
</blockquote>
</div>
<br>
</blockquote>
<br>
</body>
</html>