Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.7, 5.6.1, 5.7.0
-
None
-
Linux AMD64, GCC 6.1
-
8
-
a0f9aef11bd3a692f9fa9c6069ca27200ef82893 (qt/qtbase/dev)
-
Team 2 Foundation_Sprint 47
Description
Unlike Q_OBJECT, which is used in QObject subclasses, which can be considered exported (because of the vtable), Q_GADGET is used in value classes, which should not be exported as a whole.
Requiring exporting the class for Q_GADGET use will make people export classes which shouldn't be exported, exacerbating the problems with exported value classes (like QPolygon) we already have and thwarting attempts to reduce the number of exported value classes.
Example:
class QNetworkRawHeader { Q_GADGET Q_PROPERTY(QByteArray name READ name) Q_PROPERTY(QByteArray value READ value) public: // ... };
yields:
../../../../../include/QtCore/../../../qtbase/src/corelib/kernel/qmetatype.h:1430: error: undefined reference to 'QNetworkRawHeader::staticMetaObject'