Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to produce Capital hexadecimal digits with QString::arg() ? [QT]

I'm trying to create a QString which is a hexadecimal number with its letter digits in Capitals instead of small caps, how can it be done?

QString( " %1" ).arg( 15, 1, 16 )

yields f and I'd like F

like image 550
Petruza Avatar asked Jun 18 '10 22:06

Petruza


1 Answers

By converting the string to upper case:

QString( " %1" ).arg( 15, 1, 16 ).toUpper();

This returns an uppercase string. The method used to be called upper() in qt3.

like image 98
dantje Avatar answered Oct 05 '22 23:10

dantje