On Saturday 27 August 2011 10:01:56 Andre Somers wrote: > Op 26-8-2011 13:54, [email protected] schreef: > >> I suppose the goal of this exception is to keep source compatibility. > >> (forward delcaration would break if the namespace change) So I would > >> say yes, modules which are meant to keep source compatibility should > >> not have a namespace > > > > I agree, that was the goal of the exception. > > Is it possible to do both at once: make it possible for these modules to > either be used with or without a namespace? > If you make an exception > now, you will have to make it again for 6. If you make using namespaces > the recommended way now for *all* modules, then at least you can be > consistent for new code. For Qt 6, non-namespaced modules can then be > depricated.
How? The problem is that it is technically hard. The problem is the forward declared class. If you do class QSvgGenerator; That mean that class is in the global namsepcace. and lot of application writen for Qt4 do that. One solution is to deprecate forward declaration of classes, and force the inclusion of a header containing all the forward declarations. Then in Qt6 we can add the namespace. If there is no forward declaration, then one just add using namespace QtSvg, and it is source compatible (I think) But forbidding forward declaration is hard to enforce May I suggest that we have also namespace for new Qt Essentials modules? Namespace is a good C++ feature. And then, if a module move from essentials to addons during (in Qt6, or even durring Qt5 live time) it is already in a namespace. -- Olivier _______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
