Localized text for QFileDevice::FileError constants
-
wrote on 18 Jul 2019, 12:15 last edited by
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?
-
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?
wrote on 18 Jul 2019, 12:18 last edited byReplying to my own question:
QIODevice::errorString()
should solve the problem. -
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?
wrote on 18 Jul 2019, 12:26 last edited by@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.
-
@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 :-)
1/4