[Interest] New connection syntax

Thiago Macieira thiago.macieira at intel.com
Wed Dec 17 18:58:04 CET 2014

On Wednesday 17 December 2014 08:35:33 André Somers wrote:
> Thiago Macieira schreef op 16-12-2014 17:13:
> > On Tuesday 16 December 2014 12:41:35 Igor Mironchik wrote:
> >> And my question is: is it ok to use QtPrivate::FunctionPointer in my
> >> classes?
> > 
> > No. That's only permitted for code that is part of Qt itself (hosted on
> > qt-
> > project.org, part of qt.git)
> Isn't it a bit strange that there are things in the public API that
> really are private?


For two reasons:

1) We need a lot of code in the public headers in order to do things that 
appear in inline code. Take classes like QListData, QHashNode, or even the 
<type_traits> replacement that we carry for systems without it. We need them, 
but we never meant for people to use them. They may change unpredictably.

2) it's not public API at all. It's in public headers, but it's undocumented 
and therefore private API.

> If you built your own code on top of Qt, then I at least find it nice to
> be able to create similar API to what Qt offers so it is easier to use
> for other developers. This is made more difficult by things like this.
> It was easy to offer an API like the
>       QAction <qthelp://com.trolltech.qt.484/qdoc/qaction.html>*
>       QToolBar::addAction( constQString
>       <qthelp://com.trolltech.qt.484/qdoc/qstring.html>&/text/,
>       constQObject
>       <qthelp://com.trolltech.qt.484/qdoc/qobject.html>*/receiver/,
>       constchar*/member/)
> in your own code. Nothing private there. But apparently, mirroring Qt
> API design for the sake of consistency is no longer possible?

You can do whatever you want in your own code. But if you use undocumented 
parts of the Qt API, we can't promise it will continue to work. There are 
other ways of doing the same.

The same also applies to undocumented behaviour of libc or even undocumented 
processor instructions. If you use them, you're on your own.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Interest mailing list