Ahh, I am going crazy! First I thought the same, wysota, but before replying I had a quick look at the i18n example of the docs where they have the function
void LanguageChooser::checkBoxToggled()
{
QCheckBox *checkBox
= qobject_cast<QCheckBox
*>
(sender
());
MainWindow *window = mainWindowForCheckBoxMap[checkBox];
if (!window) {
translator.load(qmFileForCheckBoxMap[checkBox]);
qApp->installTranslator(&translator);
window = new MainWindow;
window->setPalette(colorForLanguage(checkBox->text()));
window->installEventFilter(this);
mainWindowForCheckBoxMap.insert(checkBox, window);
}
window->setVisible(checkBox->isChecked());
}
void LanguageChooser::checkBoxToggled()
{
QCheckBox *checkBox = qobject_cast<QCheckBox *>(sender());
MainWindow *window = mainWindowForCheckBoxMap[checkBox];
if (!window) {
QTranslator translator;
translator.load(qmFileForCheckBoxMap[checkBox]);
qApp->installTranslator(&translator);
window = new MainWindow;
window->setPalette(colorForLanguage(checkBox->text()));
window->installEventFilter(this);
mainWindowForCheckBoxMap.insert(checkBox, window);
}
window->setVisible(checkBox->isChecked());
}
To copy to clipboard, switch view to plain text mode
and thought (puzzled) that it would be possible. Now after having a closer look I understand the documentations code full and it isn't possible. Off course! Sometimes the examples are very trappy.
Edit: Nice question style with the /* ??? */ comment and you haven't forgot to place it inside the code
Bookmarks