Fixed crash after retranslation UI.
--HG-- branch : develop
This commit is contained in:
parent
9a5fa4b026
commit
3d297d657c
|
@ -62,9 +62,9 @@ TapeConfigDialog::TapeConfigDialog(QWidget *parent)
|
||||||
pathPage = new TapePathPage();
|
pathPage = new TapePathPage();
|
||||||
pagesWidget->addWidget(pathPage);
|
pagesWidget->addWidget(pathPage);
|
||||||
|
|
||||||
QPushButton *applyButton = new QPushButton(tr("Apply"));
|
applyButton = new QPushButton(tr("Apply"));
|
||||||
QPushButton *canselButton = new QPushButton(tr("&Cancel"));
|
canselButton = new QPushButton(tr("&Cancel"));
|
||||||
QPushButton *okButton = new QPushButton(tr("&Ok"));
|
okButton = new QPushButton(tr("&Ok"));
|
||||||
|
|
||||||
createIcons();
|
createIcons();
|
||||||
connect(contentsWidget, &QListWidget::currentItemChanged, this, &TapeConfigDialog::changePage);
|
connect(contentsWidget, &QListWidget::currentItemChanged, this, &TapeConfigDialog::changePage);
|
||||||
|
|
|
@ -113,11 +113,14 @@ QString TMainWindow::CurrentFile() const
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TMainWindow::RetranslateTable()
|
void TMainWindow::RetranslateTable()
|
||||||
|
{
|
||||||
|
if (m != nullptr)
|
||||||
{
|
{
|
||||||
const int row = ui->tableWidget->currentRow();
|
const int row = ui->tableWidget->currentRow();
|
||||||
RefreshTable();
|
RefreshTable();
|
||||||
ui->tableWidget->selectRow(row);
|
ui->tableWidget->selectRow(row);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TMainWindow::SetBaseMHeight(int height)
|
void TMainWindow::SetBaseMHeight(int height)
|
||||||
|
@ -1356,25 +1359,43 @@ void TMainWindow::InitWindow()
|
||||||
ui->labelBaseHeightValue->setText(QString().setNum(m->BaseHeight()) + " " +
|
ui->labelBaseHeightValue->setText(QString().setNum(m->BaseHeight()) + " " +
|
||||||
VDomDocument::UnitsToStr(m->MUnit(), true));
|
VDomDocument::UnitsToStr(m->MUnit(), true));
|
||||||
|
|
||||||
|
// Because Qt Designer doesn't know about our deleting we will create empty objects for correct
|
||||||
|
// working the retranslation UI
|
||||||
// Tab Measurements
|
// Tab Measurements
|
||||||
delete ui->labelFormula;
|
|
||||||
delete ui->horizontalLayoutValue;
|
delete ui->horizontalLayoutValue;
|
||||||
delete ui->plainTextEditFormula;
|
delete ui->plainTextEditFormula;
|
||||||
delete ui->pushButtonGrow;
|
|
||||||
delete ui->toolButtonExpr;
|
delete ui->toolButtonExpr;
|
||||||
|
|
||||||
|
delete ui->labelFormula;
|
||||||
|
ui->labelFormula = new QLabel(this);
|
||||||
|
|
||||||
|
delete ui->pushButtonGrow;
|
||||||
|
ui->pushButtonGrow = new QPushButton(this);
|
||||||
|
|
||||||
// Tab Information
|
// Tab Information
|
||||||
delete ui->labelGivenName;
|
|
||||||
delete ui->lineEditGivenName;
|
delete ui->lineEditGivenName;
|
||||||
delete ui->labelFamilyName;
|
|
||||||
delete ui->lineEditFamilyName;
|
delete ui->lineEditFamilyName;
|
||||||
delete ui->labelBirthDate;
|
|
||||||
delete ui->dateEditBirthDate;
|
|
||||||
delete ui->labelSex;
|
|
||||||
delete ui->comboBoxSex;
|
delete ui->comboBoxSex;
|
||||||
delete ui->labelEmail;
|
|
||||||
delete ui->lineEditEmail;
|
delete ui->lineEditEmail;
|
||||||
|
|
||||||
|
delete ui->labelGivenName;
|
||||||
|
ui->labelGivenName = new QLabel(this);
|
||||||
|
|
||||||
|
delete ui->labelFamilyName;
|
||||||
|
ui->labelFamilyName = new QLabel(this);
|
||||||
|
|
||||||
|
delete ui->labelBirthDate;
|
||||||
|
ui->labelBirthDate = new QLabel(this);
|
||||||
|
|
||||||
|
delete ui->dateEditBirthDate;
|
||||||
|
ui->dateEditBirthDate = new QDateEdit(this);
|
||||||
|
|
||||||
|
delete ui->labelSex;
|
||||||
|
ui->labelSex = new QLabel(this);
|
||||||
|
|
||||||
|
delete ui->labelEmail;
|
||||||
|
ui->labelEmail = new QLabel(this);
|
||||||
|
|
||||||
const QStringList listHeights = VMeasurement::WholeListHeights(mUnit);
|
const QStringList listHeights = VMeasurement::WholeListHeights(mUnit);
|
||||||
const QStringList listSizes = VMeasurement::WholeListSizes(mUnit);
|
const QStringList listSizes = VMeasurement::WholeListSizes(mUnit);
|
||||||
|
|
||||||
|
@ -1411,18 +1432,31 @@ void TMainWindow::InitWindow()
|
||||||
ui->lineEditEmail->setEnabled(true);
|
ui->lineEditEmail->setEnabled(true);
|
||||||
|
|
||||||
// Tab Measurements
|
// Tab Measurements
|
||||||
delete ui->labelBaseValue;
|
|
||||||
delete ui->doubleSpinBoxBaseValue;
|
delete ui->doubleSpinBoxBaseValue;
|
||||||
delete ui->labelInSizes;
|
|
||||||
delete ui->doubleSpinBoxInSizes;
|
delete ui->doubleSpinBoxInSizes;
|
||||||
delete ui->labelInHeights;
|
|
||||||
delete ui->doubleSpinBoxInHeights;
|
delete ui->doubleSpinBoxInHeights;
|
||||||
|
|
||||||
|
delete ui->labelBaseValue;
|
||||||
|
ui->labelBaseValue = new QLabel(this);
|
||||||
|
|
||||||
|
delete ui->labelInSizes;
|
||||||
|
ui->labelInSizes = new QLabel(this);
|
||||||
|
|
||||||
|
delete ui->labelInHeights;
|
||||||
|
ui->labelInHeights = new QLabel(this);
|
||||||
|
|
||||||
// Tab Information
|
// Tab Information
|
||||||
delete ui->labelBaseSize;
|
delete ui->labelBaseSize;
|
||||||
|
ui->labelBaseSize = new QLabel(this);
|
||||||
|
|
||||||
delete ui->labelBaseSizeValue;
|
delete ui->labelBaseSizeValue;
|
||||||
|
ui->labelBaseSizeValue = new QLabel(this);
|
||||||
|
|
||||||
delete ui->labelBaseHeight;
|
delete ui->labelBaseHeight;
|
||||||
|
ui->labelBaseHeight = new QLabel(this);
|
||||||
|
|
||||||
delete ui->labelBaseHeightValue;
|
delete ui->labelBaseHeightValue;
|
||||||
|
ui->labelBaseHeightValue = new QLabel(this);
|
||||||
|
|
||||||
ui->lineEditGivenName->setText(m->GivenName());
|
ui->lineEditGivenName->setText(m->GivenName());
|
||||||
ui->lineEditFamilyName->setText(m->FamilyName());
|
ui->lineEditFamilyName->setText(m->FamilyName());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user