April 2018
Beginner
714 pages
18h 21m
English
A common task is to have a string that needs to be dynamic in such a way that its content depends on the value of some external variable—for instance, you would like to inform the user about the number of files being copied, showing "copying file 1 of 2" or "copying file 2 of 5" depending on the value of counters that denote the current file and the total number of files. It might be tempting to do this by assembling all the pieces together using one of the available approaches:
QString str = "Copying file " + QString::number(current)
+ " of " + QString::number(total);
There are a number of drawbacks to such an approach; the biggest one is the problem of translating the string into other languages, wherein different ...
Read now
Unlock full access