Skip to content

Instantly share code, notes, and snippets.

@andref
andref / main.cpp
Created May 30, 2012 19:47
Calling QMetaMethods with QVariant arguments and best-effort type conversion
#include <QtCore>
#include <QtDebug>
QVariant call(QObject* object, QMetaMethod metaMethod, QVariantList args)
{
// Convert the arguments
QVariantList converted;
// We need enough arguments to perform the conversion.