QStringParser::formatArg() for pointer
Posted: Fri Feb 19 2021 12:39 am
Ripping out some really bad code in this port to CopperSpice I've stumbled onto an issue. I can find nothing in the documentation for QStringParser::formatArg() that will let one format an address.
https://www.copperspice.com/docs/cs_api/class_qstringparser.html#a07fa9007c038539e56ce22ca6347d416
The bad code was using the sprintf() family and %p to get a hex address. So far I haven't been able to properly build the message.
It's almost like there needs to be another method like this sans the precision.
The format code could be 'x' or 'H' to indicate hex. Perhaps even A for address?
https://www.copperspice.com/docs/cs_api/class_qstringparser.html#a07fa9007c038539e56ce22ca6347d416
The bad code was using the sprintf() family and %p to get a hex address. So far I haven't been able to properly build the message.
Code: Select all
QTreeWidgetItem *item
msg = QStringParser::formatArg( msg, reinterpret_cast<void *>(item), 0, 16);
no known conversion for argument 1 from ‘void*’ to
msg = QStringParser::formatArg( msg, item, 0, 16);
no known conversion for argument 1 from ‘QTreeWidgetItem*’
Code: Select all
T QStringParser::formatArg ( const T & str,
V value,
int fieldwidth = 0,
char format = 'g',
int precision = 6,
QChar32 fillChar = QChar32(' ')
)