[Qt-interest] Problem with QString.arg()

Thiago Macieira thiago.macieira at trolltech.com
Wed Apr 8 17:48:59 CEST 2009


Allen, Matthew wrote:
>/usr/include/QtCore/qstring.h:129: note: candidate 1: QString
> QString::arg(double, int, char, int, const QChar&) const
> /usr/include/QtCore/qstring.h:625: note: candidate 2: QString
> QString::arg(int, int, int, const QChar&) const
>
>The line it is bitching about is:
>
>tmpString.append(QString("%1").arg((int)i, 2, 10, '0') + "|");

None of the arguments match the arg() functions exactly. Your arguments 
are:

	int
	int
	int
	char

The problem is the last argument, the char. Note that the arg() overloads 
take a QChar.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090408/eb3847c4/attachment.bin 


More information about the Qt-interest-old mailing list