Solved Localized text for QFileDevice::FileError constants
-
Are these compatible with the C runtime
errno
constants and thestrerror()
function? That is, can I pass the numeric error code returned byQFileDevice::error()
to thestrerror()
function to generate a meaningful message I can display in a message box?Or is there a different way to do it in Qt?
-
Replying to my own question:
QIODevice::errorString()
should solve the problem. -
@Robert-Hairgrove said in Localized text for QFileDevice::FileError constants:
Are these compatible with the C runtime errno constants and the strerror() function?
QFileDevice::FileError
is an enum. You can check out the values here.
I dont think that these values (0-14) can be translated to C.If you need to display the actual error as text, you could check the error code and map it to a matching message box.
-
@Pl45m4 said in Localized text for QFileDevice::FileError constants:
you could check the error code and map it to a matching message box
Or call QIODevice::errorString() if localisation is not needed :-)