QtOpenGL: use nullary version of qRegisterMetaType<T>("T")

Using the nullary version has the advantage that multiple calls
during a program run are much more efficient, since an inlined
atomic is used to store the result. For this, it requires
Q_DECLARE_METATYPE(T), so add, too.

Change-Id: Ic9a9013aa13ff9d8f917f9df033dd2197944f84a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Marc Mutz 2012-07-20 11:02:31 +02:00 committed by Qt by Nokia
parent b3694d1295
commit 15f041e6d5

View File

@ -377,12 +377,16 @@ private:
QGLContext *m_ctx;
};
QT_END_NAMESPACE
Q_DECLARE_METATYPE(GLuint)
QT_BEGIN_NAMESPACE
class Q_OPENGL_EXPORT QGLTextureDestroyer : public QObject
{
Q_OBJECT
public:
QGLTextureDestroyer() : QObject() {
qRegisterMetaType<GLuint>("GLuint");
qRegisterMetaType<GLuint>();
connect(this, SIGNAL(freeTexture(QGLContext *, QPlatformPixmap *, GLuint)),
this, SLOT(freeTexture_slot(QGLContext *, QPlatformPixmap *, GLuint)));
}