Qt provides a set of classes and functions for easily converting between different types of data. This makes Qt more than just a GUI library; it is a complete platform for software development. The QVariant class, which we will be using in the following example, makes Qt even more flexible and powerful compared to the similar conversion functionalities provided by the C++ standard library.
Converting data
How to do it...
Let's learn how to convert various data types in Qt by following these steps:
- Open Qt Creator and create a new Qt Console Application project by going to File| New File or Project:
- Open main.cpp and add the following headers to it:
#include <QCoreApplication>
#include <QDebug>
#include...