Checking if the content language uses the Right to left direction?



  • 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();
    

  • Moderators

    @Prmego
    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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.