{
Handlers[name] = handler;
}
-
- inline void unregisterHandler(const QModulesPrivate::Names name);
};
} // namespace
return &qt_kernel_variant_handler;
}
-inline void HandlersManager::unregisterHandler(const QModulesPrivate::Names name)
-{
- Handlers[name] = &qt_dummy_variant_handler;
-}
-
Q_CORE_EXPORT void QVariantPrivate::registerHandler(const int /* Modules::Names */name, const QVariant::Handler *handler)
{
handlerManager.registerHandler(static_cast<QModulesPrivate::Names>(name), handler);
}
-Q_CORE_EXPORT void QVariantPrivate::unregisterHandler(const int /* Modules::Names */ name)
-{
- handlerManager.unregisterHandler(static_cast<QModulesPrivate::Names>(name));
-}
-
/*!
\class QVariant
\brief The QVariant class acts like a union for the most common Qt data types.
namespace QVariantPrivate {
Q_CORE_EXPORT void registerHandler(const int /* Modules::Names */ name, const QVariant::Handler *handler);
-Q_CORE_EXPORT void unregisterHandler(const int /* Modules::Names */ name);
}
#if !defined(QT_NO_DEBUG_STREAM)
bool QGuiApplicationPrivate::obey_desktop_settings = true;
extern void qRegisterGuiVariant();
-extern void qUnregisterGuiVariant();
extern void qInitDrawhelperAsm();
extern void qInitImageConversions();
clearPalette();
- qUnregisterGuiVariant();
-
#ifndef QT_NO_CURSOR
d->cursor_list.clear();
#endif
}
Q_CONSTRUCTOR_FUNCTION(qRegisterGuiVariant)
-void qUnregisterGuiVariant()
-{
- QVariantPrivate::unregisterHandler(QModulesPrivate::Gui);
- qMetaTypeGuiHelper = 0;
-}
-Q_DESTRUCTOR_FUNCTION(qUnregisterGuiVariant)
-
-
QT_END_NAMESPACE
}
Q_CONSTRUCTOR_FUNCTION(qRegisterWidgetsVariant)
-void qUnregisterWidgetsVariant()
-{
- QVariantPrivate::unregisterHandler(QModulesPrivate::Widgets);
- qMetaTypeWidgetsHelper = 0;
-}
-Q_DESTRUCTOR_FUNCTION(qUnregisterWidgetsVariant)
-
-
QT_END_NAMESPACE
#include <qmatrix4x4.h>
#include <qpen.h>
#include <qpolygon.h>
+#include <qpalette.h>
#include <qtransform.h>
#include <qvector2d.h>
#include <qvector3d.h>
void loadQt5Stream();
void saveQt5Stream_data();
void saveQt5Stream();
+
+ void guiVariantAtExit();
+ void widgetsVariantAtExit();
private:
void dataStream_data(QDataStream::Version version);
void loadQVariantFromDataStream(QDataStream::Version version);
QVERIFY(msgHandler.testPassed());
}
+void tst_QVariant::guiVariantAtExit()
+{
+ // crash test, it should not crash at QGuiApplication exit
+ static QVariant cursor = QCursor();
+ static QVariant point = QPoint();
+ static QVariant image = QImage();
+ static QVariant pallete = QPalette();
+ Q_UNUSED(cursor);
+ Q_UNUSED(point);
+ Q_UNUSED(image);
+ Q_UNUSED(pallete);
+ QVERIFY(true);
+}
+
+void tst_QVariant::widgetsVariantAtExit()
+{
+ // crash test, it should not crash at QGuiApplication exit
+ static QVariant icon= QIcon();
+ static QVariant sizePolicy = QSizePolicy();
+ Q_UNUSED(icon);
+ Q_UNUSED(sizePolicy);
+ QVERIFY(true);
+}
+
QTEST_MAIN(tst_QVariant)
#include "tst_qvariant.moc"