Solved Type cast in Qt
-
Hi all,
Can you show me how to convert following type cast expression according to Qt style?
(qint64)nBytes (size_t)no_written
Thanks
-
@russjohn834
There is no "Qt style" for this, it's pure C++.
Use eitherstatic_cast<qint64>(nBytes)
, or possiblyreinterpret_cast<qint64>(nBytes)
depending on your intention. Explanation in e.g. https://www.quora.com/How-do-you-explain-the-differences-among-static_cast-reinterpret_cast-const_cast-and-dynamic_cast-to-a-new-C++-programmer -
Thank you @JonB