HI.
How to insert record with null column values.
Thanks!!!
To bind a NULL value, use a null QVariant; for example, use QVariant(QVariant::String) if you are binding a string.
namespace qx {
template <> void register_class(QxClass<my_class> & t)
{
//...
t.data(& my_class::m_variant, "variant"); // m_variant is a QVariant type
//...
}}
template <> struct QxStringCvt_ToVariant< QVariant > {
static inline QVariant toVariant(const QVariant & t, const QString & format, int index)
{ Q_UNUSED(t); Q_UNUSED(format); Q_UNUSED(index); return t; } };
template <> struct QxStringCvt_FromVariant< QVariant > {
static inline qx_bool fromVariant(const QVariant & v, QVariant & t, const QString & format, int index)
{ Q_UNUSED(format); Q_UNUSED(index); t = v; return qx_bool(true); } };
Users browsing this forum: No registered users and 2 guests