Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-101676

QtQuick.Pdf cannot be imported

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 6.3.0 Beta2
    • PDF
    • None
    • Kubuntu 21.10
    • Linux/X11

    Description

      In CMakeLists.txt:

      find_package(Qt6 6.3.0 REQUIRED COMPONENTS Gui Qml Pdf)
      
      # [ . . . ]
      target_link_libraries(TestoApp PRIVATE
          Qt::Gui
          Qt::Qml
          Qt::Pdf
      )

      In application main.qml:

      import QtQuick.Pdf
      
      // [ . . . ]
      
      PdfDocument {
          id: doc
          source: Qt.resolvedUrl( root.source )
      }
      

      In build output:

      [13/21 58.6/sec] Generating .rcc/qmlcache/TestoApp_main_qml.cpp
      Warning: main.qml:4:1: Warnings occurred while importing module "QtQuick.Pdf":
      import QtQuick.Pdf
      ^^^^^^
      ---
      Warning: QML types file does not exist: /home/XXX/Qt/6.3.0/gcc_64/qml/QtQuick/Pdf/plugins.qmltypes
      ---Warning: main.qml:14:2: PdfDocument was not found. Did you add all import paths?
      	PdfDocument {
      	^^^^^^^^^^^
      Warning: main.qml:16:3: Binding assigned to "source", but no property "source" exists in the current element.
      		source: Qt.resolvedUrl( root.source )
      		^^^^^^
      Info: main.qml:4:1: Unused import at main.qml:4:1
      import QtQuick.Pdf
      ^^^^^^
      

      Structure under /home/XXX/Qt/6.3.0/gcc_64/qml/QtQuick/Pdf:

      ./qmldir
      ./qtpdfquickplugin.debug
      ./libqtpdfquickplugin.so
      ./qml
      ./qml/PdfStyle.qml
      ./qml/PdfMultiPageView.qml
      ./qml/PdfScrollablePageView.qml
      ./qml/PdfPageView.qml
      
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              srutledg Shawn Rutledge
              jbrend Jeffrey Brendecke
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes