Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

change the layout of keyboard!



  • hi every body,
    I have a virtual keyboard widget which has a lot of pushbuttons as keys! I used tr() function to name the pushbuttons. there is a key which changes the layout of keyboard to another language. when I change the language by :

    QTranslator     qtTranslator;
    qtTranslator.load("virtualBoard_fa");
    qApp->installTranslator(&qtTranslator);
    

    I dont know how to refresh pushbuttons to show new layout to the user. any idea?
    any idea to refresh a widget with a lot of pushbuttons to change their names by tr() function!


  • Moderators

    See the docs for installTranslator. You need to react to the LanguageChanged event and call tr for your buttons again. Example here.


Log in to reply