Folio properties: paper size presets A0-A5, landscape or portrait

A "Format" choice in the folio dimensions box sets the columns and rows
so the whole folio, title block included, has the size of an ISO A
sheet at the 96 dpi the PDF export uses. A4 landscape keeps 60 px
columns and 80 px rows and comes out as an A4 page in the PDF.

Nothing new is stored: the choice only fills in the columns and rows.
A folio whose size already matches a paper shows that paper; any other
shows "Custom". Changing the title block template after picking a paper
fits the folio again; a template too tall for the paper falls back to
"Custom".

The same box is in Folio properties and in the new-folio defaults of
the project and application settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-07 17:36:22 +13:00
parent 0708338bce
commit 2752e6705c
7 changed files with 303 additions and 2 deletions
+33
View File
@@ -336,6 +336,30 @@ QString TitleBlockPropertiesWidget::currentTitleBlockTemplateName() const
return QString();
}
/**
@brief TitleBlockPropertiesWidget::currentTitleBlockHeight
@return the height of the current title block template
*/
int TitleBlockPropertiesWidget::currentTitleBlockHeight() const
{
const TitleBlockTemplate *tbt = nullptr;
if (!currentTitleBlockTemplateName().isEmpty())
tbt = templateForIndex(ui -> m_tbt_cb -> currentIndex());
if (!tbt)
tbt = QETApp::defaultTitleBlockTemplate();
return tbt ? tbt -> height() : 0;
}
/**
@brief TitleBlockPropertiesWidget::currentTitleBlockEdge
@return the edge of the folio the title block is displayed at
*/
Qt::Edge TitleBlockPropertiesWidget::currentTitleBlockEdge() const
{
return ui -> m_display_at_cb -> currentIndex() == 0 ? Qt::BottomEdge
: Qt::RightEdge;
}
/**
@brief TitleBlockPropertiesWidget::addCollection
add a collection of title block available in the combo box
@@ -388,6 +412,15 @@ void TitleBlockPropertiesWidget::initDialog(
this,
&TitleBlockPropertiesWidget::changeCurrentTitleBlockTemplate);
auto size_changed = [this]() {
emit titleBlockSizeChanged(currentTitleBlockHeight(),
currentTitleBlockEdge());
};
connect(ui->m_tbt_cb, qOverload<int>(&QComboBox::currentIndexChanged),
this, size_changed);
connect(ui->m_display_at_cb, qOverload<int>(&QComboBox::currentIndexChanged),
this, size_changed);
if (project!= nullptr){
keys_2 = project -> folioAutoNum().keys();
foreach (QString str, keys_2) { ui -> auto_page_cb -> addItem(str); }