Check QVariant type
Hi all,
I initialize a QVariant this way:
- float my_float;
- my_float = 12.2;
- QVariant my_variant;
- ...
- ...
- ...
- ...
now I need to be sure it’s a float and not a double or an int.
QVariant::Type doesn’t have “float” but I actually check the type this way:
- {
- }
this seems to works but I get a warning while compiling:
- warning: comparison between 'enum QVariant::Type' and 'enum QMetaType::Type'
Is this the right way to check the QVariant type?
3 replies
You must log in to post a reply. Not a member yet? Register here!




