Don't try to retranslate strings for native color dialogs

If the native color dialog is in use we haven't created any of the
widgets and will crash when trying to update them.

Change-Id: I6c43cc47359110c3b9db7cacb62581446cc6f7a3
Fixes: QTBUG-75858
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
Tor Arne Vestbø 2019-05-16 14:51:42 +02:00
parent 387691498a
commit 5e743adc20

View File

@ -1858,6 +1858,9 @@ void QColorDialogPrivate::_q_addCustom()
void QColorDialogPrivate::retranslateStrings() void QColorDialogPrivate::retranslateStrings()
{ {
if (nativeDialogInUse)
return;
if (!smallDisplay) { if (!smallDisplay) {
lblBasicColors->setText(QColorDialog::tr("&Basic colors")); lblBasicColors->setText(QColorDialog::tr("&Basic colors"));
lblCustomColors->setText(QColorDialog::tr("&Custom colors")); lblCustomColors->setText(QColorDialog::tr("&Custom colors"));