Pimpl copying

Frans Englich englich at kde.org
Fri Jul 14 10:24:29 BST 2006


On Friday 14 July 2006 08:33, André Wöbbeking wrote:
> On Thursday 13 July 2006 23:05, Peter Kümmel wrote:
[...]
> > This introduces a new macro KDE_PIMPL_COPYABLE
> > which declares the pimpl AND the copy functions.
> >
> > KDE_PIMPL_UNCOPYABLE declares the copy functions
> > as private, so we get an error at compile time.
> >
> > Or is there already a Qt way to handle this?
>
> Q_DISABLE_COPY

Yupp, Q_DISABLE_COPY is great for that.

The problem is that it's not public API. I've requested Trolltech to make it 
public API(N117559) but didn't get a concrete reply: "Indeed, I've passed 
this on to the appropriate people and they will look into if we want to make 
these public at some point."

Same goes for other macros such as Q_GLOBAL_STATIC*(which also is used in KDE) 
but there I got an explcit reply that it's not public API and intends to stay 
that way.

Simon, could you look into making Q_DISABLE_COPY public API for Qt 4.2? Would 
be really practical since many use it.

I think Qt should keep all their private macro/functions in a private file, 
just as how they do with FooPrivate classes.


Cheers,

		Frans




More information about the kde-core-devel mailing list