diff options
Diffstat (limited to 'src/declarative/qml/ftw/qhashedstring_p.h')
-rw-r--r-- | src/declarative/qml/ftw/qhashedstring_p.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/declarative/qml/ftw/qhashedstring_p.h b/src/declarative/qml/ftw/qhashedstring_p.h index 2fddf24b5c..f4dd6ee87f 100644 --- a/src/declarative/qml/ftw/qhashedstring_p.h +++ b/src/declarative/qml/ftw/qhashedstring_p.h @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the QtDeclarative module of the Qt Toolkit. ** @@ -104,6 +104,8 @@ public: inline v8::Handle<v8::String> string() const; + inline QString toString() const; + private: v8::String::CompleteHashData m_hash; v8::Handle<v8::String> m_string; @@ -917,6 +919,17 @@ v8::Handle<v8::String> QHashedV8String::string() const return m_string; } +QString QHashedV8String::toString() const +{ + QString result; + result.reserve(m_hash.length); + + for (int i = 0; i < m_hash.length; ++i) + result.append(m_string->GetCharacter(i)); + + return result; +} + QHashedStringRef::QHashedStringRef() : m_data(0), m_length(0), m_utf8length(-1), m_hash(0) { |