سؤال

How to convert from cryptopp::integer to QString?

If it's important I work on Mac OS. I absolutely don't know what to do, only trying to use QCA, but it wasn't good enough!

هل كانت مفيدة؟

المحلول 2

Based on your feedback to my comment, it seems that you need three steps.

1) Call the BitCount() method to get the number of bits in the integer.

2) Then, you can get all the bits by using the GetBits() method.

3) Once that is done, you can call use the QString::number() method to get the actual integer into the desiredQString` as the return value of the static method.

نصائح أخرى

How to convert from cryptopp::integer to QString?

You could also do something like this:

CryptoPP::Integer i = 1;
i <<= 128;
i--;
i *= 3;

ostringstream oss;
oss << std::hex << i;

QString qs(oss.str().c_str());
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top