diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2012-05-11 12:01:41 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-24 12:52:43 +0200 |
commit | d2e557c2c2d7fcf3bf7c1676df3902e115986dc2 (patch) | |
tree | 65f47e443efa9635a2634880c01dc439817f9566 /src/qml/qml/ftw/qhashedstring_p.h | |
parent | 0a3ff88f851771e52d119fab90c0254de6950585 (diff) |
Lazily create QMetaObjects
For internal QML built types, creating a metaobject each time is
just wasteful. Additionally, as the property caches were always
created from the intermediate QMetaObject, it was difficult to pass
information directly from the compiler to the property cache.
Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/qml/qml/ftw/qhashedstring_p.h')
-rw-r--r-- | src/qml/qml/ftw/qhashedstring_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h index f8099d508b..cdc1577987 100644 --- a/src/qml/qml/ftw/qhashedstring_p.h +++ b/src/qml/qml/ftw/qhashedstring_p.h @@ -157,6 +157,8 @@ public: QString toString() const; + inline bool isLatin1() const; + inline int utf8length() const; QByteArray toUtf8() const; void writeUtf8(char *) const; @@ -1337,6 +1339,13 @@ int QHashedStringRef::utf8length() const return m_utf8length; } +bool QHashedStringRef::isLatin1() const +{ + for (int ii = 0; ii < m_length; ++ii) + if (m_data[ii].unicode() > 127) return false; + return true; +} + bool QHashedStringRef::startsWithUpper() const { if (m_length < 1) return false; |