Unset the font of application



  • Hi

    I have a problem with translation process. When translating the application to Persian I changed font to "Tahoma". It should be set to default font when program is translated to English. I'm looking for a way to clear or unset font of application.



  • Where did you change the font?



  • [quote author="peppe" date="1317052182"]Where did you change the font?[/quote]

    @void MainWindow::translateToPersian()
    {
    this->translateTo("fa");
    qApp->setFont(QFont("Tahoma",10));
    }@



  • What does happen if you pass an empty QFont()?
    Have you considered setting your application-wide font using an stylesheet an QApplication::setStyleSheet()?



  • Save the font you were using before then set it back.

    [quote]
    What does happen if you pass an empty QFont()?
    [/quote]

    QFont() returns the font set with QApplication::setFont.



  • [quote author="Lukas Geyer" date="1317058590"]What does happen if you pass an empty QFont()?
    Have you considered setting your application-wide font using an stylesheet an QApplication::setStyleSheet()?[/quote]

    Nothing happens.
    I don't want to deal with fonting things. Just removed Tahoma for Persian interface. But it will be nice if there were some mean for resetting UI fonts :-/



  • Using style sheets is no option for you? They can be changed easily.


  • Moderators

    You could query the qApplication->font(); at the start of the program, and save the font that is returned originally. Then you can keep it on hand for when you want to revert back to it.


Log in to reply
 

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