diff options
author | Lauro Neto <lauro.neto@openbossa.org> | 2009-10-31 14:50:56 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2009-11-09 15:31:30 -0200 |
commit | b6db1498536ce909dad79e85c00f0cec9a4e0340 (patch) | |
tree | c63e1e41fc58847c5e75e607a1edbfedcb5307eb | |
parent | b70c2847a571ae6bad4bd99535bf6f587c7b7371 (diff) |
Use isStream instead of hardcoding QDataStream
Also added documentation
-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 ^^^^^^^^^^^^^^ |