diff options
-rw-r--r-- | abstractmetabuilder.cpp | 3 | ||||
-rw-r--r-- | doc/typesystem_specifying_types.rst | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp index c4e437073..0cd479911 100644 --- a/abstractmetabuilder.cpp +++ b/abstractmetabuilder.cpp @@ -220,8 +220,7 @@ void AbstractMetaBuilder::traverseStreamOperator(FunctionModelItem item) AbstractMetaClass *streamClass = argumentToClass(arguments.at(0)); AbstractMetaClass *streamedClass = argumentToClass(arguments.at(1)); - if (streamClass && streamedClass - && (streamClass->name() == "QDataStream" || streamClass->name() == "QTextStream")) { + if (streamClass && streamedClass && (streamClass->isStream())) { AbstractMetaClass *oldCurrentClass = m_currentClass; m_currentClass = streamedClass; AbstractMetaFunction *streamFunction = traverseFunction(item); diff --git a/doc/typesystem_specifying_types.rst b/doc/typesystem_specifying_types.rst index e94873834..ec16a59a6 100644 --- a/doc/typesystem_specifying_types.rst +++ b/doc/typesystem_specifying_types.rst @@ -170,7 +170,8 @@ value-type <typesystem> <value-type name="..." copyable="yes | no" - hash-function="..." /> + hash-function="..." + stream="yes | no" /> </typesystem> The **name** attribute is the fully qualified C++ class name, such as @@ -178,6 +179,10 @@ value-type force or not specify if this type is copyable. The *optional* **hash-function** attribute informs the function name of a hash function for the type. + The *optional* attribute **stream** specifies whether this type will be able to + use externally defined operators, like QDataStream << and >>. If equals to **yes**, + these operators will be called as normal methods within the current class. + .. _object-type: @@ -193,7 +198,8 @@ object-type <typesystem> <object-type name="..." copyable="yes | no" - hash-function="..." /> + hash-function="..." + stream="yes | no" /> </typesystem> The **name** attribute is the fully qualified C++ class name. If there is no @@ -202,6 +208,10 @@ object-type **copyable** and **hash-function** attributes are the same as described for :ref:`value-type`. + The *optional* attribute **stream** specifies whether this type will be able to + use externally defined operators, like QDataStream << and >>. If equals to **yes**, + these operators will be called as normal methods within the current class. + interface-type ^^^^^^^^^^^^^^ |