Peter Kuemmel
2011-09-24 12:49:50 UTC
The discussion about public signals has shown that
with current C++ and moc techniques it is not possible
to elegantly solve the problem of protected signals
with statically checked connection calls.
Because of this I propose that in Qt5 the moc mechanism
should be expanded by the generation of public headers.
For instance qobject.h:
#ifndef QOBJECT_H
#define QOBJECT_H
#ifndef QT_NO_QOBJECT
#include <QtCore/qobjectdefs.h>
#include <QtCore/qstring.h>
#include <QtCore/qbytearray.h>
// generated by moc into the build directory
#include <qobject_moc.h>
This would give much more flexibility with generated code.
This extension would add new ways of programming Qt classes
and would allow new features.
Additionally, relying on generated code is always better
than on hand written boilerplate code.
I know, many people think this a step in the wrong direction,
but moccing is a reality in Qt, and Qt never had a C++ purist
ideology, on the contrary Qt always was very pragmatically.
It's time to open another door in C++/Qt development.
Peter
with current C++ and moc techniques it is not possible
to elegantly solve the problem of protected signals
with statically checked connection calls.
Because of this I propose that in Qt5 the moc mechanism
should be expanded by the generation of public headers.
For instance qobject.h:
#ifndef QOBJECT_H
#define QOBJECT_H
#ifndef QT_NO_QOBJECT
#include <QtCore/qobjectdefs.h>
#include <QtCore/qstring.h>
#include <QtCore/qbytearray.h>
// generated by moc into the build directory
#include <qobject_moc.h>
This would give much more flexibility with generated code.
This extension would add new ways of programming Qt classes
and would allow new features.
Additionally, relying on generated code is always better
than on hand written boilerplate code.
I know, many people think this a step in the wrong direction,
but moccing is a reality in Qt, and Qt never had a C++ purist
ideology, on the contrary Qt always was very pragmatically.
It's time to open another door in C++/Qt development.
Peter
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone