开发者

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

开发者 https://www.devze.com 2023-01-04 04:26 出处:网络
I\'m trying to create a QString which is a hexadecimal nu开发者_如何学Cmber with its letter digits in Capitals instead of small caps, how can it be done?

I'm trying to create a QString which is a hexadecimal nu开发者_如何学Cmber 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消