Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Checking if the content language uses the Right to left direction?
Prmego last edited by
Is there a built-in method in Qt or another way to check if the content language uses the Right-to-Left direction?
QFile fileHandle("c:/file.txt"); if(!fileHandle.open(QFile::ReadOnly|QFile::Text)) return; QTextStream fileContent(&fileHandle); fileContent.setCodec("UTF-8"); fileContent.setGenerateByteOrderMark(false); ui->plainTextEdit->setPlainText(fileContent.readAll()); fileHandle.close();
if you mean just by reading a file? Then no.
The UTF-8 encoded data in the txt file doesn't even have to be text at all. It depends if you are trying to interpret it as such.
Are the files written by yourself? If so you could add the left-to-right information to the file and handle it appropriatly when reading it again.