#include <QtDebug>
#include <QVariant>
struct Test
{
QString str;
operator QVariant() const
{
return QVariant::fromValue(*this);
}
};
Q_DECLARE_METATYPE(Test)
//qRegisterMetaType<Test>(); //注册 跨线程使用信号槽
inline QDebug operator<< (QDebug debug, const Test& t)
{
debug.nospace() << "Test(" << t.str << ")"; return debug.space();
}
#include <QVariant>
struct Test
{
QString str;
operator QVariant() const
{
return QVariant::fromValue(*this);
}
};
Q_DECLARE_METATYPE(Test)
//qRegisterMetaType<Test>(); //注册 跨线程使用信号槽
inline QDebug operator<< (QDebug debug, const Test& t)
{
debug.nospace() << "Test(" << t.str << ")"; return debug.space();
}