oopapidocs
2.0
|
00001 #ifndef QOBJECTWRITER_H 00002 #define QOBJECTWRITER_H 00003 00004 #include "dobjs_export.h" 00005 #include <QString> 00006 #include <QStringList> 00007 #include <QObject> 00008 #include <QMap> 00009 #include <QVariant> 00010 00013 class DOBJS_EXPORT VariantWriter { 00014 public: 00016 virtual QString toString(const QVariant& variant, const QMetaProperty& meta) const = 0; 00017 }; 00018 00021 //start 00022 class DOBJS_EXPORT QObjectWriter : public VariantWriter { 00023 public: 00025 QObjectWriter(const VariantWriter* vw = 0, bool children=true); 00026 void mapType(QVariant::Type t, VariantWriter* vw); 00027 virtual QString toString(const QVariant& variant, const QMetaProperty& meta) const; 00028 virtual QStringList propertyNames(const QObject* obj) const ; 00029 virtual QString toString(const QObject* obj, int indentLevel = 0) const; 00030 private: 00031 const VariantWriter* m_vwriter; 00032 bool m_children; 00033 QMap<QVariant::Type, VariantWriter*> m_map; 00034 }; 00035 //end 00036 #endif // #ifndef QOBJECTWRITER_H