The main problem is that Qt sees "0"
as an ASCII string with zero termination, so the compiler reports about const char[2]
.
In addition, QString::remove()
accepts two arguments. Thus, the code should be:
if( price1.at( 0 ) == '0' ) price1.remove( 0, 1 );
This builds and works on my system (Qt 4.7.3, VS2005).
source share