develtar / qt-pdf-viewer-library

The qt-pdf-viewer-library is a qml wrapper of pdf.js library which allows you to render PDF files in a WebView. This library also works on Android devices, and it uses WebSocketServer, WebSocketTransport and WebChannel to exchange data between qml and the browser environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

module "it.ltdev.qt.qml.components" is not installed

ic005k opened this issue · comments

First of all thank you for doing such a great job.

When I load "PdfPage.qml" into a quickWidget, it always reports the following error:

qrc:/sample/PdfPage.qml:10:1: module "it.ltdev.qt.qml.components" is not installed
The import it.ltdev.qt.qml.com 1.0 as LTDev ponents

I tried to install the module using the following method:
engine-> AddImportPath: ("/");
or
Qputenv: (" QML2_IMPORT_PATH ", "/");
It still doesn't work.

However, when I used QQmlApplicationEngine to load "PdfPage.qml", everything worked perfectly.

Do you have any suggestions, please? Thank you very much!

Also, can simplify the use of this module ponents "it.ltdev.qt.qml.com"? I found it to have a lot of hierarchical directories, which was a little confusing.

Thanks again.

Or, can you write a demo using QQuickWidget? Hard work!

To solve the problem, just add this code:

ui->quickWidget->engine()->addImportPath(":/");

Thanks again, perfect.

Thank you @ic005k, i'm glad you solved the problem!