Selaa lähdekoodia

Added qHash function for QSharedPointer for Qt < 4.7.

Sascha Zelzer 14 vuotta sitten
vanhempi
commit
080b43cc51
1 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  1. 9 0
      Libs/PluginFramework/ctkPluginFramework_global.h

+ 9 - 0
Libs/PluginFramework/ctkPluginFramework_global.h

@@ -29,4 +29,13 @@ typedef QHash<QString, QVariant> ServiceProperties;
 typedef QHash<QString, QVariant> ctkDictionary;
 typedef QHash<QString, QVariant> ctkProperties;
 
+#if QT_VERSION < 0x040700
+#include <QSharedPointer>
+template<class T>
+inline uint qHash(const QSharedPointer<T>& ptr)
+{
+  return qHash<T>(ptr.data());
+}
+#endif
+
 #endif // CTKPLUGINFRAMEWORK_GLOBAL_H