How to get a long variable from QVariant
-
wrote on 26 Apr 2023, 14:40 last edited by
When the type of a QVariant variable is QMetaType::Long, how can I get a C++ long variable?
QVariant offers the method toLongLong, but the result is a qlonglong variable. Is it possible that toInt would be equivalent to toLong?
-
When the type of a QVariant variable is QMetaType::Long, how can I get a C++ long variable?
QVariant offers the method toLongLong, but the result is a qlonglong variable. Is it possible that toInt would be equivalent to toLong?
Lifetime Qt Championwrote on 26 Apr 2023, 15:46 last edited by Christian EhrlicherThen use QVariant::value<long>(). But since sizeof(long long) = sizeof(long) on all 64 bit platforms - why do you need it?
1/2