diff --git a/sources/ui/titleblockpropertieswidget.cpp b/sources/ui/titleblockpropertieswidget.cpp index edce4217f..d561a3c57 100644 --- a/sources/ui/titleblockpropertieswidget.cpp +++ b/sources/ui/titleblockpropertieswidget.cpp @@ -194,7 +194,16 @@ TitleBlockProperties TitleBlockPropertiesWidget::properties() const prop.useDate = TitleBlockProperties::UseDateValue; prop.date = ui->m_date_edit->date(); } - else if (ui->m_current_date_rb->isVisible() && ui->m_current_date_rb->isChecked()) { + else if (!ui->m_current_date_rb->isHidden() && ui->m_current_date_rb->isChecked()) { + /* isVisible() (unlike isHidden()) also depends on the whole + * ancestor chain being visible, not just this widget's own + * state -- inside a QTabWidget page (both the New Project and + * Project Properties dialogs embed this widget in one), it's + * false whenever this isn't the active tab, silently dropping + * "current date" back to the useDate/date default (no date) + * even though the radio button is still checked underneath. + * isHidden() mirrors the read side's own check in initDialog(), + * and isn't affected by an ancestor tab switch. */ prop.useDate = TitleBlockProperties::CurrentDate; prop.date = QDate::currentDate(); } @@ -237,7 +246,16 @@ TitleBlockProperties TitleBlockPropertiesWidget::propertiesAutoNum( prop.useDate = TitleBlockProperties::UseDateValue; prop.date = ui->m_date_edit->date(); } - else if (ui->m_current_date_rb->isVisible() && ui->m_current_date_rb->isChecked()) { + else if (!ui->m_current_date_rb->isHidden() && ui->m_current_date_rb->isChecked()) { + /* isVisible() (unlike isHidden()) also depends on the whole + * ancestor chain being visible, not just this widget's own + * state -- inside a QTabWidget page (both the New Project and + * Project Properties dialogs embed this widget in one), it's + * false whenever this isn't the active tab, silently dropping + * "current date" back to the useDate/date default (no date) + * even though the radio button is still checked underneath. + * isHidden() mirrors the read side's own check in initDialog(), + * and isn't affected by an ancestor tab switch. */ prop.useDate = TitleBlockProperties::CurrentDate; prop.date = QDate::currentDate(); }