Hi,
i use this Example for dynamic translation.
How can i verify if my applicatin begin and end translating? I have try to send a signal:
application.h
{
Q_OBJECT
public:
explicit Application(int& argc, char* argv[]);
~Application();
//...
public slots:
static void setLanguage(const QString& locale);
// ...
signals:
static void languageChanging(int);
};
class Application : public QApplication
{
Q_OBJECT
public:
explicit Application(int& argc, char* argv[]);
~Application();
//...
public slots:
static void setLanguage(const QString& locale);
// ...
signals:
static void languageChanging(int);
};
To copy to clipboard, switch view to plain text mode
application.cpp
void Application::setLanguage(const QString& locale)
{
emit languageChanging(true);
// remove previous
if (current)
{
removeTranslator(current);
}
// install new
current = translators.value(locale, 0);
if (current)
{
installTranslator(current);
}
emit languageChanging(false);
}
void Application::setLanguage(const QString& locale)
{
emit languageChanging(true);
// remove previous
if (current)
{
removeTranslator(current);
}
// install new
current = translators.value(locale, 0);
if (current)
{
installTranslator(current);
}
emit languageChanging(false);
}
To copy to clipboard, switch view to plain text mode
but my compiler say error ... : static member functions do not have 'this' pointers
and i think thats OK but what can i do?
Bookmarks