How can I add QtPdf module to Qt Design Studio?
-
I am a user of Qt Design Studio 4.4.0. I would like to add PdfViewer element to my designs. But I get the error messages:
"module "QtQuick.Pdf" is not installed"
An explanation to add QtPdf module to Qt Design Studio will be appreciated. Thank you.
-
Hello mate!
I am going to tell how you can do it in Windows and Qt Design Studio 4.1.0 (But it will be more or less the same for other versions)
- Go to QT_FOLDER/msvc/ instalation folder
C:\Qt\6.6.0\msvc2019_64\qml\QtQuick
- Copy Pdf folder
- Go to Tools/QtDesignStudio folder
C:\Qt\Tools\QtDesignStudio-4.1.0-lts\qt6_design_studio_reduced_version\qml\QtQuick
- Paste Pdf folder.
I dont know if this generates another error but at least it will find the module.
Notes:
- Your QtQuick.Pdf module version should be equal or higher than the indicated in QtDesignStudio>Help>About Qt Design Studio
In my case:
Based on Qt 6.5.4 (MSVC 2019, x86_64)
-
@afalsa Thanks for answer.
I tried. I have copied the Pdf folders of versions 6.5.4, 6.6.2* and 6.7.0 to the location mentioned.
None of them worked. Still when I tried to run the design project I get the error message:
Cannot load library C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\qml\QtQuick\Pdf\pdfquickplugin.dll: The specified module could not be found. (file:///{SOMETHING ABOUT MY PROJECT}.qml:6, (null))
It is in fact in that location.
*PS: Instead of "QtDesignStudio>Help>About Qt Design Studio" Qt version we should copy the QT Design Studio's Kit version (6.6.2 in my case).
-
@Serhan-Kars said in How can I add QtPdf module to Qt Design Studio?:
Cannot load library C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\qml\QtQuick\Pdf\pdfquickplugin.dll: The specified module could not be found. (file:///{SOMETHING ABOUT MY PROJECT}.qml:6, (null))
It is in fact in that location.
My guess: Even though
pdfquickplugin.dll
is in that location, you have some missing dependencies. Use https://github.com/lucasg/Dependencies to examine that DLL and see what's missing. -
@JKSH Thank you for the answer. Yes I have used dependencies to find the missing dlls.
Copied missing dlls to the same location with pdfquickpluign.dll. Currently I hove no missing dependencies but my problem continues (with the same error message) -
Well, it is true.
Indeed, adding this to .qmlproject doesnt reveal anything helpfull
QML_IMPORT_TRACE: "1" QT_QML_DEBUG: "1" QT_DECLARATIVE_DEBUG: "1"
Debug: locateLocalQmldir: QtQuick.Pdf module's qmldir found at "C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/qml/QtQuick/Pdf/qmldir" ((null):0, (null)) Warning: QQmlApplicationEngine failed to load component ((null):0, (null)) Warning: file:////BaseComponent.qml:3:1: No se puede cargar la biblioteca C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\qml\QtQuick\Pdf\pdfquickplugin.dll: No se puede encontrar el módulo especificado. (file:///BaseComponent.qml:3, (null))
Now I'm a bit lost
-
@Serhan-Kars said in How can I add QtPdf module to Qt Design Studio?:
Copied missing dlls to the same location with pdfquickpluign.dll
In Windows, a plugin's dependencies are not loaded from the plugin's own folder. You need to put those DLLs in the same folder where the previewer loads Qt6Core.dll (
C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\bin
in your case)By the way, here is the bug report about the missing "QtQuick.Pdf" module: https://bugreports.qt.io/browse/QDS-10888
-
@JKSH said in How can I add QtPdf module to Qt Design Studio?:
C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\bin
Thank you very much @JKSH. Copying the dlls that plugin needed to C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\bin solved my problem
-
-
somehow I oversaw that - 4.5 will have it, next time just create a bug report and we will see it earlier - https://bugreports.qt.io/browse/QDS-12654