App: Retranslate page header titles
This fixes a bug that is only practically effects the title of the language page not updating the header when changing the language.
This commit is contained in:
parent
de4d757650
commit
a2c85a8531
@ -162,6 +162,12 @@ void PageContainer::createUI()
|
||||
setLayout(m_layout);
|
||||
}
|
||||
|
||||
void PageContainer::retranslate()
|
||||
{
|
||||
if (m_currentPage)
|
||||
m_header->setText(m_currentPage->displayName());
|
||||
}
|
||||
|
||||
void PageContainer::addButtons(QWidget *buttons)
|
||||
{
|
||||
m_layout->addWidget(buttons, 2, 0, 1, 2);
|
||||
@ -239,3 +245,11 @@ bool PageContainer::saveAll()
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void PageContainer::changeEvent(QEvent* event)
|
||||
{
|
||||
if (event->type() == QEvent::LanguageChange) {
|
||||
retranslate();
|
||||
}
|
||||
QWidget::changeEvent(event);
|
||||
}
|
||||
|
@ -66,8 +66,11 @@ public:
|
||||
m_container = container;
|
||||
};
|
||||
|
||||
void changeEvent(QEvent*) override;
|
||||
|
||||
private:
|
||||
void createUI();
|
||||
void retranslate();
|
||||
|
||||
public slots:
|
||||
void help();
|
||||
|
Loading…
Reference in New Issue
Block a user