Basically we're keeping the track of object types in a variable of QVariant::Type and then doing something like that
switch(values[i].type)
{
case QVariant::Bool: logic; break;
case QVariant::Int: logic; break;
case QVariant::LongLong: logic; break;
case QVariant::String: logic; break;
case QVariant::Double: logic; break;
case QVariant::DateTime:
case QVariant::Date:
case QVariant::Time: logic; break;
case QVariant::User+1:
{
logic;break;
}
case QVariant::User+2:
{
logic;break;
}
default: break;
}
The problem is: gcc produces warnings along these lines for User+X statements:
warning: case value ‘1025’ not in enumerated type ‘QVariant::Type’ [-Wswitch]
Now, I could suppress that of course, but is that the recommended way or am I doing something fundamentally wrong here?
P.S. The question isn't about why the warning is produced: I understand why. The queston is more about using QVariant::Type with user types in a proper way and if simply suppressing is correct or what am I doing here is just plain wrong and warning is an indication of a bigger design decision problem.