How it works...

All the data types provided by Qt, such as QString, QDateTime, and QVariant, contain functions that make conversion to other types easy and straightforward. Qt also provides its own object conversion function, qobject_cast(), which doesn't rely on the standard library. It is also more compatible with Qt and works well for converting between Qt's widget types and data types.

Qt also provides you with the QtMath class, which helps you to manipulate number variables, such as rounding up a floating point number or converting an angle from degrees to radians. QVariant is a special class that can be used to store data of all kinds of types, such as int, float, char, string, and so on. It can automatically determine the data type by examining the value stored in the variable. You can also easily convert the data into any of the types supported by the QVariant class by just calling a single function, such as toFloat(), toInt(), toBool(), toChar(), or toString().

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset