Reputation: 1
So I've had to work on an assignment for uni, and it has to be done in Qt 5.3. I've written the program in version 5.13 and simply used the .back() function to convert from QString to QChar. However, I find out that we must use 5.3 and this function was only introduced in 5.10.
Are there any other ways to do this? Already tried toAscii(), toLatin1(), but nothing works. Also, I'm not trying to convert to char*.
cout << "Enter latitude coordinates: " << endl;
input_lat = cin.readLine();
QList<QString> lat_list = input_lat.split(" ");
int d_lat = lat_list[0].toInt();
int m_lat = lat_list[1].toInt();
int s_lat = lat_list[2].toInt();
QChar dir_lat = lat_list[3].back().toUpper();
This was working fine in Qt 5.13.
Thanks,
Upvotes: 0
Views: 1672
Reputation: 958
The documentation tells you how to replace this function:
Returns the last character in the string. Same as at(size() - 1).
Upvotes: 2