Load files into QList of PageBase objects

A document is first loaded as a generic PageBase before being converted to
level one pages afterwards.

This is preparation for loading pages of other types such as DRCS and Public
Object Pages. The latter will need further work as the non-TTI file loaders
blindly assume X/1 to X/25 are 7-bit odd parity coded.

This also reverts 0a1c018 putting back the copy constructor that allows
a PageBase to be converted to a LevelOnePage.
This commit is contained in:
Gavin MacGregor
2025-05-27 17:34:18 +01:00
parent 42fd870749
commit 8675cef6c5
7 changed files with 69 additions and 30 deletions

View File

@@ -1069,9 +1069,11 @@ void MainWindow::loadFile(const QString &fileName)
QApplication::setOverrideCursor(Qt::WaitCursor);
QList<PageBase> subPages;
QVariantHash metadata;
if (loadingFormat->load(&file, m_textWidget->document(), &metadata)) {
if (loadingFormat->load(&file, subPages, &metadata)) {
m_textWidget->document()->loadFromList(subPages);
m_textWidget->document()->loadMetaData(metadata);
if (m_saveFormats.isExportOnly(QFileInfo(file).suffix()))