Tip me plase, how to insert a null value into table using Trolltech Qt 4.x SQL classes?
QSqlQuery, I guess, or something else from QtNetwork.
As analog of it, in .NET there is the
System.DbNull class, which represents sql NULL.
And what type should I use for some object's property, that can hold both null-value and
QString? In C# I could use
To bind a NULL value, use a null QVariant; for example, use QVariant(QVariant::String) if you are binding a string.
The question is for QT 4, but I think it's worth mentioning that in QT 5 you have only to pass a NULL value.