문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top