mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-13 10:04:13 +02:00
Merge pull request #696 from ispyisail/fix/current-date-preset-bug308
Fix "use current date" preset lost unless the Folio tab is active on save (bugtracker #308)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user