Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QHelpEngine problem - create empty file
Qt 6.11 is out! See what's new in the release blog

QHelpEngine problem - create empty file

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 367 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mk33
    wrote on last edited by
    #1

    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

    Pl45m4P 1 Reply Last reply
    0
    • M mk33

      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

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @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 debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mk33
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • M mk33 has marked this topic as solved on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved