QHelpEngine problem - create empty file
-
Hello, I have probelm with load help file. Simple example.
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtHelp/QHelpEngine> #include <QDebug> #include <QFile> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); QString collectionFile = "collection.qhc"; auto engine = new QHelpEngine(collectionFile, this); bool ok = engine->setupData(); if (!ok) { qDebug() << "nejde setupData()"; } /* ok = engine->registerDocumentation("d:\\xxx\\yyy\\help\\test.qch"); if (!ok) { qDebug() << engine->error(); } qDebug() << engine->registeredDocumentations(); */ }Using Qt 6.5.3 MSVC2019 I get error "Cannot register namespace "com.example.qt.653"."
I think the problem is with empty file collection.qhc (0 bytes size). When I use same code and Qt 5.15.0 I have no problem. I get collection.qhc file with size 94,208 bytes and it contains tables structure for SQLite.
Thank you mk
-
Hello, I have probelm with load help file. Simple example.
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtHelp/QHelpEngine> #include <QDebug> #include <QFile> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); QString collectionFile = "collection.qhc"; auto engine = new QHelpEngine(collectionFile, this); bool ok = engine->setupData(); if (!ok) { qDebug() << "nejde setupData()"; } /* ok = engine->registerDocumentation("d:\\xxx\\yyy\\help\\test.qch"); if (!ok) { qDebug() << engine->error(); } qDebug() << engine->registeredDocumentations(); */ }Using Qt 6.5.3 MSVC2019 I get error "Cannot register namespace "com.example.qt.653"."
I think the problem is with empty file collection.qhc (0 bytes size). When I use same code and Qt 5.15.0 I have no problem. I get collection.qhc file with size 94,208 bytes and it contains tables structure for SQLite.
Thank you mk
@mk33 said in QHelpEngine problem - create empty file:
I think the problem is with empty file collection.qhc (0 bytes size)
So is your collection empty right now?
This says:
The help engine uses the information stored in the collectionFile for providing help. If the collection file does not already exist, it will be created.
You sure that your qhc file is loaded correctly?
-
If I use file from Qt5, i can call registerDocumentation() from Qt6 and load documentation.
File collection.qhc from Qt6 is empty and from Qt5 has this tables
ComponentFilter, ComponentMapping, ComponentTable, ContentsFilterTable, ContentsTable, FileAttributeSetTable, FileFilterTable, FileNameTable, Filter, FilterAttributeTable, FilterNameTable, FilterTable, FolderTable, IndexFilterTable, IndexTable, NamespaceTable, OptimizedFilterTable, SettingsTable, TimeStampTable, VersionFilter, VersionTable.I need load dynamically help files from directory to a newly created file. Hotfix is distribute correctly created collection.qhc with tables from Qt5 and always make a copy of it.
-
M mk33 has marked this topic as solved on