From 6d28410756ab29277807d2026b4cbd8e1c707714 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 2 Jun 2009 13:59:46 +0200 Subject: Compilation fix on MSVC Reviewed-by: alexis --- src/declarative/qml/qmlprivate.h | 46 +++++++--------------------------------- src/gui/text/qtextcontrol_p.h | 2 +- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/src/declarative/qml/qmlprivate.h b/src/declarative/qml/qmlprivate.h index 62524aa..3f41fb7 100644 --- a/src/declarative/qml/qmlprivate.h +++ b/src/declarative/qml/qmlprivate.h @@ -123,43 +123,13 @@ namespace QmlPrivate } }; - template - class has_attachedPropertiesMember - { - typedef int yes_type; - typedef char no_type; - template - struct Selector {}; - - template - static yes_type test(Selector*); - - template - static no_type test(...); - - public: - static bool const value = sizeof(test(0)) == sizeof(yes_type); - }; - - template - class has_attachedPropertiesMethod + template + struct has_qmlAttachedProperties { - typedef int yes_type; - typedef char no_type; - - template - static yes_type check(ReturnType *(*)(QObject *)); - static no_type check(...); - - public: - static bool const value = sizeof(check(&T::qmlAttachedProperties)) == sizeof(yes_type); - }; - - template - class has_attachedPropertiesMethod - { - public: - static bool const value = false; + template struct type_check; + template static char check(type_check *); + template static int check(...); + static bool const value = sizeof(check(0)) == sizeof(char); }; template @@ -191,13 +161,13 @@ namespace QmlPrivate template inline QmlAttachedPropertiesFunc attachedPropertiesFunc() { - return AttachedPropertySelector::value>::value>::func(); + return AttachedPropertySelector::value >::func(); } template inline const QMetaObject *attachedPropertiesMetaObject() { - return AttachedPropertySelector::value>::value>::metaObject(); + return AttachedPropertySelector::value >::metaObject(); } struct MetaTypeIds { diff --git a/src/gui/text/qtextcontrol_p.h b/src/gui/text/qtextcontrol_p.h index 4dac4f7..e50540a 100644 --- a/src/gui/text/qtextcontrol_p.h +++ b/src/gui/text/qtextcontrol_p.h @@ -83,7 +83,7 @@ class QAbstractScrollArea; class QEvent; class QTimerEvent; -class Q_AUTOTEST_EXPORT QTextControl : public QObject +class Q_GUI_EXPORT QTextControl : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QTextControl) -- cgit v0.12