Advertisement
mercibac

qmltranslator.h

May 25th, 2021
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1.     #ifndef QMLTRANSLATOR_H
  2.     #define QMLTRANSLATOR_H
  3.      
  4.     #include <QObject>
  5.     #include <QTranslator>
  6.      
  7.     class QmlTranslator : public QObject
  8.     {
  9.         Q_OBJECT
  10.      
  11.     public:
  12.         explicit QmlTranslator(QObject *parent = 0);
  13.      
  14.     signals:
  15.         // The signal of change the current language to change the interface translation
  16.         void languageChanged();
  17.      
  18.     public:
  19.         // Translation installation method, which will be available in QML
  20.         Q_INVOKABLE void setTranslation(QString translation);
  21.      
  22.     private:
  23.         QTranslator m_translator;
  24.     };
  25.      
  26.     #endif // QMLTRANSLATOR_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement