diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-10-25 16:58:28 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-10-25 16:58:28 +0200 |
commit | a4c1bb65572e613df99badc821c79a79764986f6 (patch) | |
tree | bfcd73a06e86f0dbecfad10d05eb4044cd46f404 /tests/client | |
parent | 6d2076c889b4d914672e2bbfd1c218252b9ed1cf (diff) | |
download | qmenumodel-a4c1bb65572e613df99badc821c79a79764986f6.tar.gz qmenumodel-a4c1bb65572e613df99badc821c79a79764986f6.tar.bz2 qmenumodel-a4c1bb65572e613df99badc821c79a79764986f6.zip |
converterTest: simplify metatype definitions
Diffstat (limited to 'tests/client')
-rw-r--r-- | tests/client/convertertest.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/client/convertertest.cpp b/tests/client/convertertest.cpp index 3bd1f74..9e13ccb 100644 --- a/tests/client/convertertest.cpp +++ b/tests/client/convertertest.cpp @@ -28,13 +28,11 @@ extern "C" { #include <QtTest> #include <QDebug> -class QGVariantType : public QObject +class QGVariantType { - Q_OBJECT public: QGVariantType() : type(NULL) {} QGVariantType(const GVariantType *gvtype) : type(gvtype) {} - QGVariantType(const QGVariantType &other) : type(other.type) {} const GVariantType *getType() const { return type; } operator const GVariantType*() const { return type; } @@ -43,14 +41,13 @@ private: }; Q_DECLARE_METATYPE(QGVariantType); -class QGVariant : public QObject +class QGVariant { - Q_OBJECT public: QGVariant() : variant(NULL) {} ~QGVariant() { if (variant) g_variant_unref(variant); } QGVariant(GVariant *gv) : variant(g_variant_ref_sink(gv)) {} - QGVariant(const QGVariant &other) : variant(g_variant_ref_sink(other.variant)) {} + QGVariant(const QGVariant &other) : QGVariant(other.variant) {} GVariant *gvariant() const { return variant; } operator GVariant*() const { return variant; } |