Add generic templates (#307)

- Add generic full-page templates.  (This feature from 3.4 was missing)
- Also add generic half-page, quarter-page, and envelope templates.
- Add several more common envelope sizes to page-sizes.xml
- Qt print backend does not need pwg_size.
    - Replace with pwg_class, to distinguish between ISO and NA sizes
This commit is contained in:
Jaye Evins
2026-02-11 11:27:41 -05:00
committed by GitHub
parent 993e1e460d
commit e6673a0a24
15 changed files with 369 additions and 67 deletions
+18 -2
View File
@@ -99,9 +99,25 @@ namespace glabels::model
Distance width = XmlUtil::getLengthAttr( node, "width", Distance(0) );
Distance height = XmlUtil::getLengthAttr( node, "height", Distance(0) );
QString pwgSize = XmlUtil::getStringAttr( node, "pwg_size", "" );
QString pwgClass = XmlUtil::getStringAttr( node, "pwg_class", "iso" );
return Paper( id, name, width, height, pwgSize );
Paper::Type type;
QString typeString = XmlUtil::getStringAttr( node, "type", "sheet" );
if ( typeString == "sheet" )
{
type = Paper::SHEET;
}
else if ( typeString == "envelope" )
{
type = Paper::ENVELOPE;
}
else
{
qWarning() << "Warning: unknown paper type: " << typeString << ".";
type = Paper::SHEET;
}
return Paper( id, name, width, height, pwgClass, type );
}